renderInfo amb animacio

This commit is contained in:
2026-03-29 17:47:48 +02:00
parent b986778bb4
commit 7551115912
3 changed files with 50 additions and 17 deletions
+7 -2
View File
@@ -8,16 +8,20 @@ class RenderInfo {
static auto get() -> RenderInfo*;
// Métodos principales
void update(float delta_time);
void render() const;
void toggle();
// Consultas
[[nodiscard]] auto isActive() const -> bool { return active_; }
[[nodiscard]] auto isActive() const -> bool { return status_ != Status::HIDDEN; }
// Altura fija del overlay (TEXT_SIZE(6) + PADDING_V(2) * 2)
static constexpr int HEIGHT = 10;
static constexpr float SLIDE_SPEED = 120.0F;
private:
enum class Status { HIDDEN, RISING, ACTIVE, VANISHING };
// Singleton
static RenderInfo* render_info;
@@ -25,5 +29,6 @@ class RenderInfo {
RenderInfo();
~RenderInfo() = default;
bool active_{false}; // Estado del overlay
Status status_{Status::HIDDEN};
float y_{static_cast<float>(-HEIGHT)};
};