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.MenuAccueil;

import java.io.File;
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 {
        new File("save.slevel");
        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 MenuAccueil();

        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();
    }
}


