-
Notifications
You must be signed in to change notification settings - Fork 9
Companion UI Components Updated
Java class called CompanionStatsDisplay.java is responsible for showing the companion information, such as heath, on the screen in an easy to read style. Furthermore it must match the style of the player and other in-game items. This wiki will provide a detailed explanation of how this feature is implemented, along with a UML diagram to visualize the class structure.
The CompanionStatsDisplay class extends UIComponent and is used for managing the UI elements related to companion statistics. It has several instance variables and methods for updating and displaying companion health. Handling alerts will be done in a new class, CompanionInGameAlerts.
A UI layout element used for organising all the relevant UI components. Bundles them all together into one section
Is a smaller UI layout elment which is embedded inside of table. It actually contains the rows of the different elements of the UI
It is a label element which contains the text of what the health level is at
Contains a stack of Images/Frame which combine to form a dynamic health bar. When the bar is full, the health is at 100.
Label element which represents what the current mode the companion is in
The class has one constructor which sets some config variables. The trigger/listeners and other creation of elements is done in create() method.
This method sets up the listeners on changing mode and changing health amount
it also calls addActors, which puts the UI elements on screen
Creates and positions UI elements (labels) for displaying companion health as a bar and companion mode. Uses frames and images to make the UI consistent with the theme of the game
Given the Ui table it adds the bar to, create the health bar.
Given the UI table, it puts the background image and the mode status over the top
Adds a button below the other UI elements. This button, when clicked, opens up the inventory UI display
Updates the companions health bar and the number of health points associated
Updates the companions mode string/status.
Cleans up resources and removes UI elements when they are no longer needed.
Maxwell Schroder (@MaxwellSchroder)
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files