-
Notifications
You must be signed in to change notification settings - Fork 0
Update to Scene Changing
Millie Macdonald edited this page Jan 18, 2017
·
1 revision
to change your button handlers to use GameManager.changeScene
replace;
exampleButton.setOnAction(this::handleButton);
...
private void handleButton(ActionEvent event) {
Stage primaryStage = (Stage) exmapleButton.getScene().getWindow();
Parent exampleScreen = null;
try {
// getResource() should look in src/main/resources
exampleScreen = FXMLLoader.load(getClass().getResource("/fxml/NewScreen.fxml"));
} catch (IOException e) {
logger.debug("IO Exception when loading NewScreen.fxml");
System.exit(1);
}
Scene scene = new Scene(exampleScreen);
primaryStage.setScene(scene);
}
with
exampleButton.setOnAction(e -> GameManager.changeScene(exampleButton, "MenuScreen.fxml"));
GameManager.changeScene
is static so you do not need to get an instance of GameManager
.
changeScene
takes a JavaFX Control object and a String of the resource name.
The resource name needs to be the name of fxml file in 'resources/fxml/'
including .fxml file extension, DO NOT include the full path to the file.
Saving and Loading
Statistics tracking
- Statistics Tracking Overview
- Statistics Tracking
- User Statistics
- Champion Statistics
- Common Statistics
Game Play
APIs
- Section One: Pyramid Scheme Beginner's Guide
- Section Two: Getting Started
- Section Three: The Pyramid
- Section Four: Game Layout Explanation
- Section Five: Cards
- Section Six: Champions
- Section Seven: DuckDust
- Section: Eight: How to play Pyramid Scheme
- Section Nine: Ways to play
- Section Ten: Deck Building
- Section Eleven: How to Acquire Cards
- Section Twelve: Achievements
- Section Thirteen: Accessories
Other Guides
Design Guides
Overviews
- Architecture Overview
- UI Overview
- Main Menu Screen Overview
- Standardised Screen Graphics
- Overview of Graphics
Features
- Story Mode
- Cutscenes
- Beginners Guide Tutorial
- Clock
- Deckbuilding
- Card Deck Gallery
- Champion Roster
- Market Place
- Card Packs
- Game Settings
- Tool-tips
Animations
Splash Screen & Create Account Screen
Player Account Settings
AI
Duck Dust
Brainstorming
- Brainstorming - General
- Brainstorming - UI
- Brainstorming - Mechanics
- Brainstorming - Pyramid Design Discussion
- Brainstorming - Champions, Abilities and Design Mock-up
- Brainstorming - Achievement
Future Development