03.08.2020
|
@ -1,6 +1,7 @@
|
||||||
package application;
|
package application;
|
||||||
|
|
||||||
import javafx.application.Preloader;
|
import javafx.application.Preloader;
|
||||||
|
import javafx.application.Preloader.ProgressNotification;
|
||||||
import javafx.application.Preloader.StateChangeNotification;
|
import javafx.application.Preloader.StateChangeNotification;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
|
@ -29,6 +30,12 @@ public class HangmanPreload extends Preloader {
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public void handleApplicationNotification(Preloader.PreloaderNotification info) {
|
||||||
|
if(info instanceof ProgressNotification) {
|
||||||
|
StartScreenController.statProgressBar.setProgress(((ProgressNotification) info).getProgress() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public void handleStateChangeNotification(Preloader.StateChangeNotification info) {
|
public void handleStateChangeNotification(Preloader.StateChangeNotification info) {
|
||||||
|
|
||||||
StateChangeNotification.Type type = info.getType();
|
StateChangeNotification.Type type = info.getType();
|
||||||
|
|
|
@ -42,29 +42,17 @@ public class Main extends Application {
|
||||||
Text info;
|
Text info;
|
||||||
@FXML
|
@FXML
|
||||||
Label title;
|
Label title;
|
||||||
@FXML
|
|
||||||
private Label progress;
|
|
||||||
public static Label label;
|
|
||||||
@FXML
|
@FXML
|
||||||
RadioButton easy;
|
RadioButton easy;
|
||||||
@FXML
|
@FXML
|
||||||
RadioButton medium;
|
RadioButton medium;
|
||||||
@FXML
|
@FXML
|
||||||
RadioButton hard;
|
RadioButton hard;
|
||||||
@FXML
|
|
||||||
private ProgressBar progressBar;
|
|
||||||
public static ProgressBar statProgressBar;
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
private void handleButtonAction(ActionEvent event) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// G A M E
|
// G A M E
|
||||||
|
|
||||||
public void initialize(URL url, ResourceBundle rb) {
|
|
||||||
label = progress;
|
|
||||||
statProgressBar = progressBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int COUNT_LIMIT = 10;
|
private static final int COUNT_LIMIT = 10;
|
||||||
|
|
||||||
|
@ -207,7 +195,7 @@ public class Main extends Application {
|
||||||
double progress = (double) i / 10;
|
double progress = (double) i / 10;
|
||||||
System.out.println("progress: " + progress);
|
System.out.println("progress: " + progress);
|
||||||
LauncherImpl.notifyPreloader(this, new Preloader.ProgressNotification(progress));
|
LauncherImpl.notifyPreloader(this, new Preloader.ProgressNotification(progress));
|
||||||
Thread.sleep(250);
|
Thread.sleep(350);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,36 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.ProgressBar?>
|
||||||
|
<?import javafx.scene.effect.Light.Distant?>
|
||||||
|
<?import javafx.scene.effect.Lighting?>
|
||||||
|
<?import javafx.scene.effect.Shadow?>
|
||||||
<?import javafx.scene.image.Image?>
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
|
||||||
|
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.StartScreenController">
|
||||||
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/11.0.1">
|
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="509.0" fitWidth="757.0" layoutX="-10.0" layoutY="-6.0">
|
<ImageView fitHeight="509.0" fitWidth="757.0" layoutX="-10.0" layoutY="-6.0">
|
||||||
<image>
|
<image>
|
||||||
<Image url="@../images/hangman.jpg" />
|
<Image url="@../images/hangman.jpg" />
|
||||||
</image>
|
</image>
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
<ImageView fitHeight="129.0" fitWidth="148.0" layoutX="592.0" layoutY="8.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/mfproduktion.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ProgressBar fx:id="progressBar" layoutX="15.0" layoutY="476.0" prefHeight="19.0" prefWidth="725.0" progress="0.0">
|
||||||
|
<effect>
|
||||||
|
<Lighting>
|
||||||
|
<bumpInput>
|
||||||
|
<Shadow />
|
||||||
|
</bumpInput>
|
||||||
|
<light>
|
||||||
|
<Light.Distant color="RED" />
|
||||||
|
</light>
|
||||||
|
</Lighting>
|
||||||
|
</effect>
|
||||||
|
</ProgressBar>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
34
HangmanFx/src/application/StartScreenController.java
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
package application;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.ProgressBar;
|
||||||
|
|
||||||
|
public class StartScreenController implements Initializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
|
public static ProgressBar statProgressBar;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void handleButtonAction(ActionEvent event) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
|
|
||||||
|
statProgressBar = progressBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -21,12 +21,12 @@
|
||||||
|
|
||||||
<AnchorPane prefHeight="424.0" prefWidth="608.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.Main">
|
<AnchorPane prefHeight="424.0" prefWidth="608.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.Main">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="425.0" fitWidth="636.0" layoutX="-2.0">
|
<ImageView fitHeight="425.0" fitWidth="634.0">
|
||||||
<image>
|
<image>
|
||||||
<Image url="@../images/bg.jpg" />
|
<Image url="@../../../../../Desktop/test.gif" />
|
||||||
</image>
|
</image>
|
||||||
</ImageView>
|
</ImageView>
|
||||||
<ImageView fx:id="hangmanImage" fitHeight="194.0" fitWidth="235.0" layoutX="393.0" layoutY="231.0" pickOnBounds="true" preserveRatio="true">
|
<ImageView fx:id="hangmanImage" fitHeight="202.0" fitWidth="256.0" layoutX="378.0" layoutY="223.0" pickOnBounds="true" preserveRatio="true">
|
||||||
<effect>
|
<effect>
|
||||||
<Bloom threshold="0.0" />
|
<Bloom threshold="0.0" />
|
||||||
</effect></ImageView>
|
</effect></ImageView>
|
||||||
|
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 29 KiB |
BIN
HangmanFx/src/images/mfproduktion.png
Normal file
After Width: | Height: | Size: 124 KiB |