You can now resize all windows other than the title screen
#story[1087]
This commit is contained in:
@@ -9,6 +9,7 @@ import javafx.scene.control.RadioButton;
|
|||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
import visualiser.app.App;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -39,7 +40,7 @@ public class TitleController extends Controller {
|
|||||||
public void hostAGame() throws IOException {
|
public void hostAGame() throws IOException {
|
||||||
titleWrapper.setVisible(false);
|
titleWrapper.setVisible(false);
|
||||||
parent.hostGame();
|
parent.hostGame();
|
||||||
|
App.getStage().setResizable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enterTitle(){
|
public void enterTitle(){
|
||||||
@@ -53,6 +54,7 @@ public class TitleController extends Controller {
|
|||||||
public void joinAGame() {
|
public void joinAGame() {
|
||||||
titleWrapper.setVisible(false);
|
titleWrapper.setVisible(false);
|
||||||
parent.enterLobby();
|
parent.enterLobby();
|
||||||
|
App.getStage().setResizable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDayMode(){
|
public void setDayMode(){
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import javafx.stage.WindowEvent;
|
|||||||
import visualiser.Controllers.MainController;
|
import visualiser.Controllers.MainController;
|
||||||
|
|
||||||
public class App extends Application {
|
public class App extends Application {
|
||||||
|
private static Stage stage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point for running the programme
|
* Entry point for running the programme
|
||||||
@@ -37,7 +38,7 @@ public class App extends Application {
|
|||||||
});
|
});
|
||||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml"));
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml"));
|
||||||
Parent root = loader.load();
|
Parent root = loader.load();
|
||||||
// stage.setResizable(false);
|
stage.setResizable(false);
|
||||||
MainController mc = (MainController) loader.getController();
|
MainController mc = (MainController) loader.getController();
|
||||||
mc.enterTitle();
|
mc.enterTitle();
|
||||||
Scene scene = new Scene(root);
|
Scene scene = new Scene(root);
|
||||||
@@ -46,6 +47,15 @@ public class App extends Application {
|
|||||||
stage.setTitle("RaceVision - Team 7");
|
stage.setTitle("RaceVision - Team 7");
|
||||||
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
|
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
|
||||||
mc.startCss();
|
mc.startCss();
|
||||||
|
setStage(stage);
|
||||||
stage.show();
|
stage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Stage getStage() {
|
||||||
|
return App.stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setStage(Stage stage) {
|
||||||
|
App.stage = stage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.Text?>
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
<AnchorPane fx:id="titleWrapper" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController">
|
<AnchorPane fx:id="titleWrapper" maxHeight="600.0" maxWidth="800.0" minHeight="600.0" minWidth="800.0" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController">
|
||||||
<children>
|
<children>
|
||||||
<GridPane layoutY="39.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<GridPane layoutY="39.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
|
|||||||
Reference in New Issue
Block a user