03.08.2020

This commit is contained in:
blues 2020-08-03 17:02:29 +02:00
parent 3c7a073220
commit ad568e0c77
21 changed files with 70 additions and 21 deletions

View File

@ -1,6 +1,7 @@
package application;
import javafx.application.Preloader;
import javafx.application.Preloader.ProgressNotification;
import javafx.application.Preloader.StateChangeNotification;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -29,6 +30,12 @@ public class HangmanPreload extends Preloader {
}
@Override
public void handleApplicationNotification(Preloader.PreloaderNotification info) {
if(info instanceof ProgressNotification) {
StartScreenController.statProgressBar.setProgress(((ProgressNotification) info).getProgress() );
}
}
@Override
public void handleStateChangeNotification(Preloader.StateChangeNotification info) {
StateChangeNotification.Type type = info.getType();

View File

@ -42,29 +42,17 @@ public class Main extends Application {
Text info;
@FXML
Label title;
@FXML
private Label progress;
public static Label label;
@FXML
RadioButton easy;
@FXML
RadioButton medium;
@FXML
RadioButton hard;
@FXML
private ProgressBar progressBar;
public static ProgressBar statProgressBar;
@FXML
private void handleButtonAction(ActionEvent event) {
}
// G A M E
public void initialize(URL url, ResourceBundle rb) {
label = progress;
statProgressBar = progressBar;
}
private static final int COUNT_LIMIT = 10;
@ -207,7 +195,7 @@ public class Main extends Application {
double progress = (double) i / 10;
System.out.println("progress: " + progress);
LauncherImpl.notifyPreloader(this, new Preloader.ProgressNotification(progress));
Thread.sleep(250);
Thread.sleep(350);
}
}

View File

@ -1,16 +1,36 @@
<?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.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/11.0.1">
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.StartScreenController">
<children>
<ImageView fitHeight="509.0" fitWidth="757.0" layoutX="-10.0" layoutY="-6.0">
<image>
<Image url="@../images/hangman.jpg" />
</image>
</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>
</AnchorPane>

View 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;
}
}

View File

@ -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">
<children>
<ImageView fitHeight="425.0" fitWidth="636.0" layoutX="-2.0">
<ImageView fitHeight="425.0" fitWidth="634.0">
<image>
<Image url="@../images/bg.jpg" />
<Image url="@../../../../../Desktop/test.gif" />
</image>
</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>
<Bloom threshold="0.0" />
</effect></ImageView>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB