Major refactoring but now centering text and sprites works. See Issue #16 for why only those and not anything else yet.

This commit is contained in:
Zed A. Shaw 2025-07-23 12:48:29 -04:00
parent 2c22da022f
commit 9e9b9620c9
6 changed files with 47 additions and 92 deletions

View file

@ -77,7 +77,7 @@ struct ClickerUI {
"[_|_ |_|_|_]"
"[_|_ |_|_|_]"
"[_|_ |_|_|_]"
"[a1|a2|a3|a4|a5]");
"[(30,30)a1|=(30,30)a2|a3|=a4|a5]");
}
void init() {
@ -91,9 +91,9 @@ struct ClickerUI {
for(auto& [name, cell] : $gui.cells()) {
auto id = $gui.entity(name);
if(name != "clicker") {
$gui.set<guecs::Rectangle>(id, {});
$gui.set<guecs::Rectangle>(id, {0, {255, 0, 0, 255}});
$gui.set<guecs::Effect>(id, {});
$gui.set<guecs::Sprite>(id, { "clicker_treat_bone" });
// $gui.set<guecs::Sprite>(id, { "clicker_treat_bone" });
$gui.set<guecs::Clickable>(id, {
[&](auto, auto) { handle_button(Event::A_BUTTON); }
});