GUECS now doesn't have the facts feature from DinkyECS and instead you refer to the whole area with gui.MAIN. This is an entity that's at 0 and represents the whole grid. Background is placed there.
This commit is contained in:
parent
abea6da2e0
commit
7c90eb6da1
5 changed files with 7 additions and 39 deletions
10
guecs.cpp
10
guecs.cpp
|
@ -182,11 +182,6 @@ namespace guecs {
|
|||
}
|
||||
|
||||
void UI::init() {
|
||||
if(has_the<Background>()) {
|
||||
auto& bg = get_the<Background>();
|
||||
bg.init();
|
||||
}
|
||||
|
||||
query<Background>([](auto, auto& bg) {
|
||||
bg.init();
|
||||
});
|
||||
|
@ -232,9 +227,8 @@ namespace guecs {
|
|||
}
|
||||
|
||||
void UI::render(sf::RenderWindow& window) {
|
||||
if(has_the<Background>()) {
|
||||
auto& bg = get_the<Background>();
|
||||
window.draw(*bg.shape);
|
||||
if(auto bg = get_if<Background>(MAIN)) {
|
||||
window.draw(*(bg->shape));
|
||||
}
|
||||
|
||||
query<Effect>([&](auto, auto& shader) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue