Use chrono::duration for animation frame durations.

This commit is contained in:
Zed A. Shaw 2026-01-19 11:50:00 -05:00
parent d81e127686
commit 5b509c277a
4 changed files with 53 additions and 12 deletions

View file

@ -10,10 +10,7 @@
#include "constants.hpp"
#include <guecs/ui.hpp>
#include "gui/event_router.hpp"
#include <chrono>
#include <thread>
using namespace std::chrono_literals;
#include "gui/guecstra.hpp"
namespace animator {
struct UI {
@ -22,8 +19,10 @@ namespace animator {
void init(const std::string& sprite_name) {
$ui.position(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);
$ui.layout(
"[*%(100,200)data|*%=(300,200)viewer|_|_]"
"[_|_|_|_]");
"[play|*%=(300,400)viewer|_|_]"
"[stop|_|_|_]"
"[next|_|_|_]"
"[prev|_|_|_]");
for(auto& [name, cell] : $ui.cells()) {
auto comp = $ui.entity(name);
@ -34,6 +33,9 @@ namespace animator {
$ui.set<guecs::Rectangle>(comp, {});
$ui.set<guecs::Text>(comp, {guecs::to_wstring(name)});
$ui.set<guecs::Effect>(comp, {});
$ui.set<guecs::Clickable>(comp, {[](auto){
fmt::println("I don't know what to do here.");
}});
}
}