Fix up the backend so it has sane names like get_sprite and get_icon, then implemented a guecs::Icon for icons. Those don't scale and typically have other properties different from a Sprite.
This commit is contained in:
parent
31a02505aa
commit
5a7c096b52
9 changed files with 76 additions and 29 deletions
|
@ -93,6 +93,10 @@ namespace guecs {
|
|||
query<lel::Cell, Sprite>([&](auto, auto &cell, auto &sprite) {
|
||||
sprite.init(cell);
|
||||
});
|
||||
|
||||
query<lel::Cell, Icon>([&](auto, auto &cell, auto &icon) {
|
||||
icon.init(cell);
|
||||
});
|
||||
}
|
||||
|
||||
void UI::debug_layout(sf::RenderWindow& window) {
|
||||
|
@ -138,6 +142,11 @@ namespace guecs {
|
|||
sprite.render(window, shader_ptr);
|
||||
});
|
||||
|
||||
query<Icon>([&](auto ent, auto& icon) {
|
||||
auto shader_ptr = find_shader(ent, false);
|
||||
icon.render(window, shader_ptr);
|
||||
});
|
||||
|
||||
query<Label>([&](auto ent, auto& text) {
|
||||
auto shader_ptr = find_shader(ent, false);
|
||||
text.render(window, shader_ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue