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.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
import visualiser.app.App;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@@ -39,7 +40,7 @@ public class TitleController extends Controller {
|
||||
public void hostAGame() throws IOException {
|
||||
titleWrapper.setVisible(false);
|
||||
parent.hostGame();
|
||||
|
||||
App.getStage().setResizable(true);
|
||||
}
|
||||
|
||||
public void enterTitle(){
|
||||
@@ -53,6 +54,7 @@ public class TitleController extends Controller {
|
||||
public void joinAGame() {
|
||||
titleWrapper.setVisible(false);
|
||||
parent.enterLobby();
|
||||
App.getStage().setResizable(true);
|
||||
}
|
||||
|
||||
public void setDayMode(){
|
||||
|
||||
@@ -12,6 +12,7 @@ import javafx.stage.WindowEvent;
|
||||
import visualiser.Controllers.MainController;
|
||||
|
||||
public class App extends Application {
|
||||
private static Stage stage;
|
||||
|
||||
/**
|
||||
* 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"));
|
||||
Parent root = loader.load();
|
||||
// stage.setResizable(false);
|
||||
stage.setResizable(false);
|
||||
MainController mc = (MainController) loader.getController();
|
||||
mc.enterTitle();
|
||||
Scene scene = new Scene(root);
|
||||
@@ -46,6 +47,15 @@ public class App extends Application {
|
||||
stage.setTitle("RaceVision - Team 7");
|
||||
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
|
||||
mc.startCss();
|
||||
setStage(stage);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static Stage getStage() {
|
||||
return App.stage;
|
||||
}
|
||||
|
||||
public static void setStage(Stage stage) {
|
||||
App.stage = stage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user