I have the overlay display the low health blood using the gui system.
This commit is contained in:
parent
70a9420c11
commit
d8e1fc7aa3
5 changed files with 50 additions and 24 deletions
14
guecs.cpp
14
guecs.cpp
|
@ -15,9 +15,17 @@ namespace guecs {
|
|||
}
|
||||
|
||||
DinkyECS::Entity UI::entity(std::string name) {
|
||||
auto entity = $world.entity();
|
||||
$world.set<CellName>(entity, {name});
|
||||
return entity;
|
||||
if($name_ents.contains(name)) {
|
||||
// already exists so just return it
|
||||
return $name_ents.at(name);
|
||||
} else {
|
||||
auto entity = $world.entity();
|
||||
// this lets you look up an entity by name
|
||||
$name_ents.insert_or_assign(name, entity);
|
||||
// this makes it easier to get the name during querying
|
||||
$world.set<CellName>(entity, {name});
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
void UI::init(TexturePack& textures) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue