You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
55 lines
1.2 KiB
package controller;
|
|
|
|
import javafx.fxml.FXML;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.fxml.Initializable;
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.image.ImageView;
|
|
import javafx.scene.input.MouseEvent;
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
import java.net.URL;
|
|
import java.util.Objects;
|
|
import java.util.ResourceBundle;
|
|
|
|
public class MainPageController implements Initializable {
|
|
|
|
@FXML
|
|
private AnchorPane mainRoot;
|
|
|
|
@FXML
|
|
private Button startGame;
|
|
|
|
@FXML
|
|
private Button viewScore;
|
|
|
|
@FXML
|
|
private ImageView exitGame;
|
|
|
|
@FXML
|
|
private ImageView loadGame;
|
|
|
|
@FXML
|
|
void exitGame(MouseEvent event) {
|
|
System.exit(0);
|
|
}
|
|
|
|
@Override
|
|
public void initialize(URL url, ResourceBundle resourceBundle) {
|
|
|
|
}
|
|
|
|
@FXML
|
|
void viewScore(MouseEvent event) throws Exception{
|
|
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/TopPlayers.fxml")));
|
|
mainRoot.getChildren().setAll(pane);
|
|
}
|
|
|
|
@FXML
|
|
void startGame(MouseEvent event) throws Exception{
|
|
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("GamePlay.fxml"));
|
|
AnchorPane pane=fxmlLoader.load();
|
|
// Appelle au controler de jeu....
|
|
}
|
|
}
|