Browse Source

add StartGame btn and switch to scene game

main
fdai7736 11 months ago
parent
commit
62a2751364
  1. 8
      src/main/java/de/hsfulda/onses/controllers/AppController.java

8
src/main/java/de/hsfulda/onses/controllers/AppController.java

@ -28,7 +28,13 @@ public class AppController implements Controller {
final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/app.fxml"))); final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/app.fxml")));
Button button = (Button) parent.lookup("#startGameBtn"); Button button = (Button) parent.lookup("#startGameBtn");
button.setOnAction(e -> {
try {
stage.setScene(new Scene(gameController.render()));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
});
return parent; return parent;
} }
} }
Loading…
Cancel
Save