Added splash and loading screen

This commit is contained in:
Kusal Ekanayake
2017-09-26 17:07:02 +13:00
parent 7027de80c4
commit 98abe64f00
9 changed files with 336 additions and 234 deletions
@@ -21,6 +21,7 @@ import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import seng302.gameServer.ServerAdvertiser;
@@ -55,10 +56,18 @@ public class ViewManager {
if (instance == null) {
instance = new ViewManager();
}
return instance;
}
public void initialiseSplashScreen(Stage stage) throws IOException {
this.stage = stage;
Parent root = FXMLLoader.load(getClass().getResource("/views/SplashScreen.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.initStyle(StageStyle.UNDECORATED);
stage.show();
}
/**
* Initialize the start view in the given stage.
*/
@@ -66,7 +75,6 @@ public class ViewManager {
this.stage = stage;
Parent root = FXMLLoader.load(getClass().getResource("/views/StartScreenView.fxml"));
stage.setTitle("Party Parrots At Sea");
JFXDecorator decorator = new JFXDecorator(stage, root, false, true, true);
decorator.setCustomMaximize(true);
decorator.applyCss();