2022-09-02 11:06:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-09-07 09:02:01 +00:00
|
|
|
#include "engine_api.h"
|
2022-09-02 23:02:09 +00:00
|
|
|
|
2022-09-02 11:06:59 +00:00
|
|
|
#include "component.hpp"
|
|
|
|
|
|
|
|
#include "resources/font.hpp"
|
|
|
|
#include "resources/mesh.hpp"
|
2022-10-24 08:34:09 +00:00
|
|
|
#include "resources/shader.hpp"
|
2022-09-02 11:06:59 +00:00
|
|
|
|
|
|
|
#include <glm/mat4x4.hpp>
|
|
|
|
|
2022-10-06 10:30:44 +00:00
|
|
|
namespace engine::components {
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
class ENGINE_API UI : public Component {
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
public:
|
|
|
|
UI(Object*);
|
|
|
|
~UI() override;
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
// called every frame, do not call manually
|
|
|
|
void render(glm::mat4 transform, glm::mat4 view);
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
std::string m_text = "hello world";
|
|
|
|
glm::vec3 m_color = { 1.0f, 1.0f, 1.0f };
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
enum class Alignment {
|
|
|
|
NONE = 0,
|
|
|
|
LEFT = 1,
|
|
|
|
RIGHT = 2
|
|
|
|
};
|
|
|
|
Alignment m_alignment = Alignment::LEFT;
|
|
|
|
bool m_scaled = true;
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
private:
|
|
|
|
std::shared_ptr<resources::Font> m_font;
|
|
|
|
std::shared_ptr<resources::Shader> m_shader;
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-27 14:35:41 +00:00
|
|
|
std::unique_ptr<resources::Mesh> m_atlasMesh;
|
|
|
|
|
|
|
|
};
|
2022-09-02 11:06:59 +00:00
|
|
|
|
2022-11-28 09:39:00 +00:00
|
|
|
}
|