animacions a renderinfo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user