Now have a full map and a mini map, but I think the mini map will stop rendering sometimes.
This commit is contained in:
parent
193d97eb48
commit
322797f787
15 changed files with 120 additions and 36 deletions
13
guecs.cpp
13
guecs.cpp
|
@ -40,6 +40,7 @@ namespace guecs {
|
|||
bg.init();
|
||||
}
|
||||
|
||||
|
||||
$world.query<Background>([](auto, auto& bg) {
|
||||
bg.init();
|
||||
});
|
||||
|
@ -75,7 +76,17 @@ namespace guecs {
|
|||
$world.query<lel::Cell, Sprite>([&](auto, auto &cell, auto &sprite) {
|
||||
sprite.init(cell);
|
||||
});
|
||||
}
|
||||
|
||||
void UI::debug_layout(sf::RenderWindow& window) {
|
||||
$world.query<lel::Cell>([&](const auto, auto &cell) {
|
||||
sf::RectangleShape rect{{float(cell.w), float(cell.h)}};
|
||||
rect.setPosition({float(cell.x), float(cell.y)});
|
||||
rect.setFillColor(sf::Color::Transparent);
|
||||
rect.setOutlineColor(sf::Color::Red);
|
||||
rect.setOutlineThickness(2.0f);
|
||||
window.draw(rect);
|
||||
});
|
||||
}
|
||||
|
||||
void UI::render(sf::RenderWindow& window) {
|
||||
|
@ -114,6 +125,8 @@ namespace guecs {
|
|||
$world.query<Textual>([&](auto, auto& text) {
|
||||
window.draw(*text.text);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool UI::mouse(float x, float y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue