first commit, frontend ish done
This commit is contained in:
commit
38091651ab
35 changed files with 505 additions and 0 deletions
26
src/Controllers/CreditsSceneController.java
Normal file
26
src/Controllers/CreditsSceneController.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package Controllers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class CreditsSceneController {
|
||||
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnMenuClicked(ActionEvent event) throws IOException {
|
||||
Parent creditsSceneParent = FXMLLoader.load(getClass().getResource("/FXML/MainScene.fxml"));
|
||||
Scene creditsScene = new Scene(creditsSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("Sids Wordle");
|
||||
window.setScene(creditsScene);
|
||||
window.show();
|
||||
}
|
||||
}
|
36
src/Controllers/GameSceneController.java
Normal file
36
src/Controllers/GameSceneController.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package Controllers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class GameSceneController {
|
||||
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnResetClicked(ActionEvent event) {
|
||||
// TODO Autogenerated
|
||||
}
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnGoClicked(ActionEvent event) {
|
||||
// TODO Autogenerated
|
||||
}
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnMenuClicked(ActionEvent event) throws IOException {
|
||||
Parent gameSceneParent = FXMLLoader.load(getClass().getResource("/FXML/MainScene.fxml"));
|
||||
Scene gameScene = new Scene(gameSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("Sids Wordle");
|
||||
window.setScene(gameScene);
|
||||
window.show();
|
||||
}
|
||||
}
|
49
src/Controllers/MainSceneController.java
Normal file
49
src/Controllers/MainSceneController.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package Controllers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class MainSceneController {
|
||||
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnPlayClicked(ActionEvent event) throws IOException {
|
||||
Parent rulesSceneParent = FXMLLoader.load(getClass().getResource("/FXML/GameScene.fxml"));
|
||||
Scene rulesScene = new Scene(rulesSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("Sids Wordle");
|
||||
window.setScene(rulesScene);
|
||||
window.show();
|
||||
}
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnRulesClicked(ActionEvent event) throws IOException {
|
||||
Parent rulesSceneParent = FXMLLoader.load(getClass().getResource("/FXML/RulesScene.fxml"));
|
||||
Scene rulesScene = new Scene(rulesSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("How to Play");
|
||||
window.setScene(rulesScene);
|
||||
window.show();
|
||||
}
|
||||
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnCreditsClicked(ActionEvent event) throws IOException {
|
||||
Parent rulesSceneParent = FXMLLoader.load(getClass().getResource("/FXML/CreditsScene.fxml"));
|
||||
Scene rulesScene = new Scene(rulesSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("Credits");
|
||||
window.setScene(rulesScene);
|
||||
window.show();
|
||||
}
|
||||
}
|
26
src/Controllers/RulesSceneController.java
Normal file
26
src/Controllers/RulesSceneController.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package Controllers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class RulesSceneController {
|
||||
|
||||
// Event Listener on Button.onAction
|
||||
@FXML
|
||||
public void btnMenuClicked(ActionEvent event) throws IOException {
|
||||
Parent rulesSceneParent = FXMLLoader.load(getClass().getResource("/FXML/MainScene.fxml"));
|
||||
Scene rulesScene = new Scene(rulesSceneParent);
|
||||
|
||||
Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();
|
||||
window.setTitle("Sids Wordle");
|
||||
window.setScene(rulesScene);
|
||||
window.show();
|
||||
}
|
||||
}
|
25
src/FXML/CreditsScene.fxml
Normal file
25
src/FXML/CreditsScene.fxml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="400.0" style="-fx-background-color: #252525;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.CreditsSceneController">
|
||||
<children>
|
||||
<Button layoutX="113.0" layoutY="438.0" mnemonicParsing="false" onAction="#btnMenuClicked" prefHeight="27.0" prefWidth="174.0" style="-fx-background-color: white;" text="Go back to Menu">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="12.0" />
|
||||
</font></Button>
|
||||
<Label layoutX="142.0" layoutY="39.0" text="Credits" textFill="WHITE">
|
||||
<font>
|
||||
<Font name="System Bold" size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label layoutX="15.0" layoutY="92.0" prefHeight="290.0" prefWidth="372.0" textFill="WHITE">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</AnchorPane>
|
56
src/FXML/GameScene.fxml
Normal file
56
src/FXML/GameScene.fxml
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="400.0" style="-fx-background-color: #252525;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.GameSceneController">
|
||||
<children>
|
||||
<ImageView fitHeight="204.0" fitWidth="210.0" layoutX="98.0" layoutY="-34.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@../logo4.jpg" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Button layoutX="335.0" layoutY="448.0" mnemonicParsing="false" onAction="#btnResetClicked" prefHeight="10.0" prefWidth="58.0" style="-fx-background-color: white;" text="Reset" textFill="RED">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="12.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TextField layoutX="74.0" layoutY="442.0" prefHeight="33.0" prefWidth="186.0" promptText="Write a word here!" style="-fx-background-color: #5166A9; -fx-border-color: white;" />
|
||||
<Button layoutX="269.0" layoutY="442.0" mnemonicParsing="false" onAction="#btnGoClicked" prefHeight="33.0" prefWidth="58.0" style="-fx-background-color: white;" text="Go">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="14.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Label fx:id="lb1" layoutX="55.0" layoutY="134.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="115.0" layoutY="134.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="175.0" layoutY="134.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="235.0" layoutY="134.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="295.0" layoutY="134.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="55.0" layoutY="194.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="115.0" layoutY="194.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="175.0" layoutY="194.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="235.0" layoutY="194.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="295.0" layoutY="194.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="55.0" layoutY="254.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="115.0" layoutY="254.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="175.0" layoutY="254.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="235.0" layoutY="254.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="295.0" layoutY="254.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="55.0" layoutY="314.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="115.0" layoutY="314.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="175.0" layoutY="314.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="235.0" layoutY="314.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="295.0" layoutY="314.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="55.0" layoutY="374.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="115.0" layoutY="374.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="175.0" layoutY="374.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="235.0" layoutY="374.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Label layoutX="295.0" layoutY="374.0" prefHeight="50.0" prefWidth="50.0" style="-fx-background-color: lightgrey;" />
|
||||
<Button layoutX="130.0" layoutY="14.0" mnemonicParsing="false" onAction="#btnMenuClicked" prefHeight="107.0" prefWidth="148.0" style="-fx-background-color: transparent;" textFill="TRANSPARENT" />
|
||||
</children>
|
||||
</AnchorPane>
|
32
src/FXML/MainScene.fxml
Normal file
32
src/FXML/MainScene.fxml
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="400.0" style="-fx-background-color: #252525;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.MainSceneController">
|
||||
<children>
|
||||
<ImageView fitHeight="400.0" fitWidth="413.0" layoutY="-48.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@../logo4.jpg" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Button layoutX="115.0" layoutY="275.0" mnemonicParsing="false" onAction="#btnPlayClicked" prefHeight="53.0" prefWidth="171.0" style="-fx-background-color: white;" text="Play">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="24.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button layoutX="115.0" layoutY="342.0" mnemonicParsing="false" onAction="#btnRulesClicked" prefHeight="53.0" prefWidth="171.0" style="-fx-background-color: white;" text="How to Play">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="18.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button layoutX="115.0" layoutY="410.0" mnemonicParsing="false" onAction="#btnCreditsClicked" prefHeight="53.0" prefWidth="171.0" style="-fx-background-color: white;" text="Credits">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="24.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</AnchorPane>
|
25
src/FXML/RulesScene.fxml
Normal file
25
src/FXML/RulesScene.fxml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="400.0" style="-fx-background-color: #252525;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.RulesSceneController">
|
||||
<children>
|
||||
<Button layoutX="113.0" layoutY="438.0" mnemonicParsing="false" onAction="#btnMenuClicked" prefHeight="27.0" prefWidth="174.0" style="-fx-background-color: white;" text="Go back to Menu">
|
||||
<font>
|
||||
<Font name="Bodoni MT Black" size="12.0" />
|
||||
</font></Button>
|
||||
<Label layoutX="98.0" layoutY="39.0" text="How to Play" textFill="WHITE">
|
||||
<font>
|
||||
<Font name="System Bold" size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label layoutX="15.0" layoutY="92.0" prefHeight="290.0" prefWidth="372.0" text="1. Lorem ipasum ... 2. tseter 3. wow 4. ok 5. shit" textFill="WHITE">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</AnchorPane>
|
1
src/application.css
Normal file
1
src/application.css
Normal file
|
@ -0,0 +1 @@
|
|||
/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
|
28
src/application/Main.java
Normal file
28
src/application/Main.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package application;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
||||
public class Main extends Application {
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
try {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("/FXML/MainScene.fxml"));
|
||||
Scene scene = new Scene(root);
|
||||
|
||||
primaryStage.setTitle("Sids Wordle!");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
BIN
src/logo.jpg
Normal file
BIN
src/logo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
src/logo.png
Normal file
BIN
src/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
src/logo2.jpg
Normal file
BIN
src/logo2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
src/logo3.jpg
Normal file
BIN
src/logo3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
src/logo4.jpg
Normal file
BIN
src/logo4.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Reference in a new issue