animacions a renderinfo

This commit is contained in:
2026-04-05 01:03:48 +02:00
parent 91f88ded09
commit 4238ae1bc4
9 changed files with 181 additions and 32 deletions

View File

@@ -10,6 +10,7 @@
#include "core/rendering/screen.hpp"
#include "core/rendering/text.hpp"
#include "game/options.hpp"
#include "utils/easing.hpp"
namespace Menu {
@@ -121,6 +122,11 @@ namespace Menu {
}
return std::string("OFF"); }, [](int dir) { Overlay::cycleRenderInfo(dir); }, nullptr});
p.items.push_back({"HORA", ItemKind::Toggle,
[] { return onOff(Options::render_info.show_time); },
[](int) { Options::render_info.show_time = !Options::render_info.show_time; },
nullptr});
return p;
}
@@ -340,9 +346,7 @@ namespace Menu {
const Page& page = stack_.back();
const int target_h = boxHeight(page);
// Ease-out quadratic: f(t) = 1 - (1-t)^2
float t = open_anim_;
float eased = 1.0F - (1.0F - t) * (1.0F - t);
float eased = Easing::outQuad(open_anim_);
// Caixa creix verticalment des del centre
int box_h = static_cast<int>(target_h * eased);