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

@ -126,6 +126,7 @@ namespace guecs {
class UI {
public:
DinkyECS::World $world;
std::unordered_map<std::string, DinkyECS::Entity> $name_ents;
shared_ptr<sf::Font> $font = nullptr;
lel::Parser $parser;
std::string $grid = "";
@ -147,6 +148,20 @@ namespace guecs {
void init(TexturePack& textures);
void render(sf::RenderWindow& window);
void mouse(float x, float y);
template <typename Comp>
void set(DinkyECS::Entity ent, Comp val) {
$world.set<Comp>(ent, val);
}
lel::Cell& cell_for(DinkyECS::Entity entity) {
return $world.get<lel::Cell>(entity);
}
template <typename Comp>
void remove(DinkyECS::Entity ent) {
$world.remove<Comp>(ent);
}
};
Clickable make_action(DinkyECS::World& target, Events::GUI event);