engine/include/components/text_ui_renderer.hpp

42 lines
693 B
C++
Raw Normal View History

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-09-03 04:56:51 +00:00
class ENGINE_API UI : public Component {
2022-09-02 11:06:59 +00:00
public:
UI(Object*);
~UI() override;
// called every frame, do not call manually
void render(glm::mat4 transform);
std::string m_text = "hello world";
glm::vec3 m_color = {1.0f, 1.0f, 1.0f};
enum class Alignment {
NONE = 0,
LEFT = 1,
RIGHT = 2
};
Alignment m_alignment = Alignment::LEFT;
bool m_scaled = true;
private:
std::shared_ptr<resources::Font> m_font;
std::shared_ptr<resources::Shader> m_shader;
};
}