Started the overlay UI but need to make it possible to add/remove components to it.
This commit is contained in:
parent
59d10a4506
commit
70a9420c11
8 changed files with 91 additions and 43 deletions
12
guecs.cpp
12
guecs.cpp
|
@ -51,17 +51,7 @@ namespace guecs {
|
|||
});
|
||||
|
||||
$world.query<lel::Cell, Sprite>([&](auto, auto &cell, auto &sprite) {
|
||||
auto sprite_texture = textures.get(sprite.name);
|
||||
sprite.texture = sprite_texture.texture;
|
||||
sprite.sprite = make_shared<sf::Sprite>(*sprite.texture);
|
||||
sprite.sprite->setPosition({
|
||||
float(cell.x + GUECS_PADDING),
|
||||
float(cell.y + GUECS_PADDING)});
|
||||
|
||||
auto size = sprite.texture->getSize();
|
||||
sprite.sprite->setScale({
|
||||
float(cell.w - GUECS_PADDING * 2) / size.x,
|
||||
float(cell.h - GUECS_PADDING * 2) / size.y});
|
||||
sprite.init(cell, textures);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue