Cutscenes - UQdeco2800/2022-studio-3 GitHub Wiki
Introduction
The cutscenes facilitate the user's introduction to the game story. They consist of dynamic images with static text involving the story line. The user may select "next" or "skip" depending on their status. Currently, the cut-scene display section supports
Usage
Images are initially loaded onto individual image variables as given below, new Images are created for every cut-scene image and initialised as private Image storyImage1
. The images were determined to be the "background" and initialised as a table table = new Table();
while the buttons were loaded as a secondary table backTable = new Table();
Overall, the images for the cut-scenes were loaded as below.
Image storyImage1 = new Image(ServiceLocator.getResourceService().getAsset("images/cutscene-3.png", Texture.class)); storyImage1.setFillParent(true); stage.addActor(storyImage1);
Additionally, a new GAME_STORY
screen was added to the game in Gdxgame.java
Buttons
A "next" button and "skip" button are present in the bottom right of the page. The "next" button flicks through the story images, the "skip" button skips to the game play.
The buttons are simple TextButtons, initialised by TextButton nextBtn = new TextButton("Next", skin);
for each respective button. When the button is pressed, an event is triggered (which may be a "next" or "skip" event). In the file, StoryAction.java
, the skip and next functionality is initialised as such:
`
private void onSkip() {
logger.info("Skipping to game");
game.setScreen(GdxGame.ScreenType.MAIN_GAME);
}`