Text can be centered wither with the centered attribute on a class or with = in the spec.

This commit is contained in:
Zed A. Shaw 2025-07-23 00:25:00 -04:00
parent 3752522597
commit 2c22da022f
2 changed files with 10 additions and 10 deletions

View file

@ -73,7 +73,7 @@ struct ClickerUI {
ClickerUI() {
$gui.position(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
$gui.layout(
"[_|*%(300,400)clicker|_|_|_]"
"[_|=*%(300,400)clicker|_|_|_]"
"[_|_ |_|_|_]"
"[_|_ |_|_|_]"
"[_|_ |_|_|_]"
@ -135,15 +135,14 @@ struct ClickerUI {
using enum Event;
switch(ev) {
case CLICKER: {
auto& shaker = $gui.get<Shake>($clicker);
auto& sprite = $gui.get<guecs::Sprite>($clicker);
shaker.play(sprite);
fmt::println("CLICKER LOVES YOU!");
} break;
auto& shaker = $gui.get<Shake>($clicker);
auto& sprite = $gui.get<guecs::Sprite>($clicker);
shaker.play(sprite);
fmt::println("CLICKER LOVES YOU!");
} break;
case A_BUTTON:
fmt::println("a button clicked");
break;
fmt::println("a button clicked");
break;
default:
assert(false && "invalid event");
}