52 lines
1.2 KiB
Java
52 lines
1.2 KiB
Java
package school_project;
|
|
|
|
import javafx.application.Application;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
|
|
import javafx.scene.input.KeyCombination;
|
|
import javafx.stage.Screen;
|
|
import javafx.stage.Stage;
|
|
import school_project.Menu.MenuAcceuil;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
public class Controller extends Application {
|
|
private static Stage stage;
|
|
Parent root;
|
|
public static Vec2 screen_size;
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) throws IOException {
|
|
stage = primaryStage;
|
|
screen_size = new Vec2(
|
|
(int) Screen.getPrimary().getBounds().getWidth(),
|
|
(int) Screen.getPrimary().getBounds().getHeight()
|
|
);
|
|
|
|
stage.setTitle("ROAD TO MASTER YOU");
|
|
|
|
// Full Screen mode
|
|
stage.setFullScreen(true);
|
|
stage.setFullScreenExitHint("");
|
|
primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
|
|
|
|
root = new MenuAcceuil();
|
|
|
|
switchRoot(root);
|
|
stage.show();
|
|
}
|
|
|
|
|
|
public static void switchRoot(Parent root){
|
|
Scene scene = new Scene(root);
|
|
stage.setScene(scene);
|
|
}
|
|
public static void main(String[] args) {
|
|
launch();
|
|
}
|
|
}
|
|
|
|
|