52 lines
1.2 KiB
Java
Raw Normal View History

2023-02-25 13:55:35 +01:00
package school_project;
import javafx.application.Application;
2023-05-04 23:24:18 +02:00
import javafx.scene.Parent;
2023-02-25 13:55:35 +01:00
import javafx.scene.Scene;
2023-05-04 23:24:18 +02:00
import javafx.scene.input.KeyCombination;
import javafx.stage.Screen;
2023-02-25 13:55:35 +01:00
import javafx.stage.Stage;
2023-05-09 13:05:53 +02:00
import school_project.Menu.MenuAcceuil;
2023-05-04 23:24:18 +02:00
import java.io.IOException;
2023-02-25 13:55:35 +01:00
public class Controller extends Application {
private static Stage stage;
2023-05-04 23:24:18 +02:00
Parent root;
public static Vec2 screen_size;
2023-02-25 13:55:35 +01:00
@Override
2023-05-04 23:24:18 +02:00
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");
2023-02-25 13:55:35 +01:00
2023-05-04 23:24:18 +02:00
// Full Screen mode
stage.setFullScreen(true);
stage.setFullScreenExitHint("");
primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
2023-02-25 13:55:35 +01:00
2023-05-09 13:05:53 +02:00
root = new MenuAcceuil();
2023-02-25 13:55:35 +01:00
2023-05-09 12:56:33 +02:00
switchRoot(root);
2023-05-04 23:24:18 +02:00
stage.show();
2023-02-25 13:55:35 +01:00
}
public static void switchRoot(Parent root){
2023-05-09 12:56:33 +02:00
Scene scene = new Scene(root);
stage.setScene(scene);
2023-04-28 11:28:10 +02:00
}
2023-02-25 13:55:35 +01:00
public static void main(String[] args) {
launch();
2023-02-25 13:55:35 +01:00
}
}
2023-04-28 11:28:10 +02:00