I have the overlay display the low health blood using the gui system.

This commit is contained in:
Zed A. Shaw 2025-02-20 08:41:45 -05:00
parent 70a9420c11
commit d8e1fc7aa3
5 changed files with 50 additions and 24 deletions

View file

@ -9,19 +9,13 @@ namespace gui {
public:
guecs::UI $gui;
GameLevel $level;
std::unordered_map<std::string, DinkyECS::Entity> $name_ents;
TexturePack& $textures;
OverlayUI(GameLevel level);
OverlayUI(GameLevel level, TexturePack& $textures);
void render(TexturePack& texture);
void render();
void draw(sf::RenderWindow& window);
void click(int x, int y);
template <typename Comp>
// this should be in the GUECS really
void set(std::string name, Comp val) {
auto ent = $name_ents.at(name);
$level.world->set<Comp>(ent, val);
}
void show_damage(bool show);
};
}