Started the overlay UI but need to make it possible to add/remove components to it.

This commit is contained in:
Zed A. Shaw 2025-02-20 02:33:09 -05:00
parent 59d10a4506
commit 70a9420c11
8 changed files with 91 additions and 43 deletions

View file

@ -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);
});
}