Files
2026-03-16 14:56:32 +01:00

29 lines
863 B
C++

#pragma once
#include <object/entity.hpp>
#include <renderer/font.hpp>
#include <renderer/texture.hpp>
#include <utility>
#include <game/input.hpp>
namespace Game::Object {
class UIText : public Entity {
public:
UIText(const std::string& name, std::shared_ptr<Renderer::Font> font, const Transform& transform, float x = 0.f, float y = 0.f);
~UIText() override = default;
void start() override;
void update(float deltaTime) override;
void setText(const std::string& text);
std::string getText() const;
void setPosition(float x, float y) { mX = x; mY = y; }
std::pair<float, float> getPosition() const { return {mX, mY}; }
private:
//void* mClickFunction = nullptr;
float mX, mY;
std::string mText;
};
}