TitleBox Class Documentation - UQcsse3200/2023-studio-2 GitHub Wiki

Overview

The TitleBox class is a custom dialog box designed for use in the [GdxGame] application. It serves as an introductory dialog box that presents a game's story and allows the user to start the game. This class extends the LibGDX Dialog class and provides a structured and visually appealing way to present game-related information.

Table of Contents

Usage

Constructor

Methods

Event Handling

Example Usage

Contributors

Usage

The TitleBox class can be used to display a dialog box with a title, a story description, and a start button. It's typically used to introduce the game's storyline to the player and allows them to begin the game when ready.

The Title Box has been used in the following Classes :-

Constructor

game: An instance of the GdxGame class. title: The title to display in the dialog box. skin: The skin to use for styling the dialog box components.

Methods

showDialog(Stage stage) This method adds the TitleBox instance to the specified stage, making it visible to the user.

stage: The Stage where the dialog should be displayed.

Event Handling

The TitleBox class uses event handling to respond to button clicks. When the "OK" button is clicked, it triggers the "ok" event, which can be handled externally.

To handle the "ok" event, you can add a listener to an instance of the Entity class. In the provided example, the onOK() method is called when the "OK" button is clicked, and it changes the game's screen to GAME_STORY.

UML Use Case Diagram

Example Usage

Contributors