Class HeadsUpDisplayFactory
java.lang.Object
com.csse3200.game.entities.factories.HeadsUpDisplayFactory
Factory to create HUD entity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateHeadsUpDisplay(String name) Creates and configures the main Heads-Up Display (HUD) entity for the game.static EntitycreatePrompt(String promptMessage, Float duration, float width, float height) Creates a new entity that acts as a physical trigger for a temporary on-screen prompt.
-
Method Details
-
createHeadsUpDisplay
Creates and configures the main Heads-Up Display (HUD) entity for the game. This entity contains various UI components responsible for persistent display elements and menus.- Parameters:
name- The name of the game area/screen (e.g., "GameScreen").- Returns:
- The fully configured UI entity.
-
createPrompt
Creates a new entity that acts as a physical trigger for a temporary on-screen prompt. This entity has a physics collider set as a sensor, and when another entity (the player) collides with it, the specified prompt is displayed for a set duration.- Parameters:
promptMessage- The text to be displayed when the prompt is triggered.duration- The time, in seconds, the prompt will remain visible.width- The width of the physical trigger entity (used for scaling).height- The height of the physical trigger entity (used for scaling).- Returns:
- The fully configured prompt trigger entity.
-