-
Notifications
You must be signed in to change notification settings - Fork 9
Revamp InitialScreenDisplay Class
The InitialScreenDisplay
class is a user interface component used to display the initial story sequence in a game developed using LibGDX. It combines background images, text animation, and navigation buttons to create an engaging and immersive storytelling experience for players. The improvement done in this sprint is by refining it in a slide show by running an array list to display images.
The InitialScreenDisplay
class serves as the initial story sequence UI component and offers the following features:
- Displaying a sequence of background images.
- Animating text letter by letter.
- Providing navigation buttons for users to interact with the story sequence.
- Integration of letter-by-letter text animation.
- Implementation of "Next," "Previous," and "Skip" buttons for user interaction.
- A table-based layout for organizing UI elements effectively.
-
Asset being used: InitialScreenImages that consist of the player companion and the ship.
-
Implementation:
The InitialScreenDisplay
class is used to display a sequence of background images and textual content in a story-driven game.
The InitialScreenDisplay
class depends on several external libraries and assets. The following libraries and assets are used:
- LibGDX for game development.
-
BitmapFont
for text rendering. -
Texture
for handling image assets. -
AssetManager
for loading assets. -
Table
andLabel
for organizing and displaying UI elements. -
ImageButton
for creating navigation buttons.
Here's how the InitialScreenDisplay
class is used:
-
Initialization: We create an instance of the
InitialScreenDisplay
class, providing essential parameters such as the game instance, asset paths, and text list. - Event Listeners: We add event listeners to respond to user interactions with the navigation buttons.
-
Initialization: The
create()
method is called to initialize the UI components. -
Configuration: We configure the layout of the story sequence using the
addUIElements()
method. - Navigation Buttons: We create and add navigation buttons for user interaction.
`The class provides various methods, including:
-
create()
: Initializes the class and UI elements. -
addUIElements()
: Adds background images, an animated planet, and text labels. -
printTextLetterByLetter(String text, Label label, float speed, float initialDelay)
: Prints text letter by letter with specified speed and initial delay. -
nextScene()
: Progresses to the next scene when the "Next" button is clicked. -
prevScene()
: Goes back to the previous scene when the "Previous" button is clicked. -
onSkip()
: Allows skipping to the game by initiating planet travel. -
draw(SpriteBatch batch)
: Handles drawing of UI components on the screen. -
update()
: Manages the movement logic for the animated planet and text animation. -
dispose()
: Cleans up resources and disposes of objects.
-
printTextLetterByLetter(String text, Label label, float speed, float initialDelay)
:
-
nextScene()
:
In conclusion, the InitialScreenDisplay
class is a vital part of our game's storytelling experience. It combines dynamic elements like text animations and navigation buttons to engage players from the beginning. Its effective layout and usage of external libraries make it a valuable asset in our game development project.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files