feat(ui): Establish a modular HUD architecture #27

Open
vym wants to merge 2 commits from feat/hud-architecture into master
Collaborator

Description

This PR introduces a modular HUD architecture in src/features/hud/.

Changes

  • Modular HUD: Created a scalable structure with separate components, resources, systems, and a flexible HUD builder.
  • Dynamic Placement: Implemented HudPlacement to easily position HUD elements.
  • GameState Integration: HUD elements are now managed by the GameState::Playing state for automatic spawning/despawning.
  • Extensible Builder: Added a spawn_hud_item builder that accepts a closure, allowing for arbitrary HUD element layouts (e.g., text, inventory, minimap).
  • Example: Included a simple inventory example at the bottom of the screen.

Acceptance Criteria

  • HUD layout is easily extensible.
  • Dynamic data reflects game state.
  • HUD only displays during gameplay.
## Description This PR introduces a modular HUD architecture in `src/features/hud/`. ## Changes - **Modular HUD:** Created a scalable structure with separate components, resources, systems, and a flexible HUD builder. - **Dynamic Placement:** Implemented `HudPlacement` to easily position HUD elements. - **GameState Integration:** HUD elements are now managed by the `GameState::Playing` state for automatic spawning/despawning. - **Extensible Builder:** Added a `spawn_hud_item` builder that accepts a closure, allowing for arbitrary HUD element layouts (e.g., text, inventory, minimap). - **Example:** Included a simple inventory example at the bottom of the screen. ## Acceptance Criteria - [ ] HUD layout is easily extensible. - [x] Dynamic data reflects game state. - [x] HUD only displays during gameplay.
This pull request has changes conflicting with the target branch.
  • .cargo/config.toml
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/hud-architecture:feat/hud-architecture
git switch feat/hud-architecture
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
floride/bevy_template!27
No description provided.