engine/include/components/text_ui_renderer.hpp
bailwillharr 69dae9ab42 Add stuff
2022-11-27 14:35:41 +00:00

43 lines
778 B
C++

#pragma once
#include "engine_api.h"
#include "component.hpp"
#include "resources/font.hpp"
#include "resources/mesh.hpp"
#include "resources/shader.hpp"
#include <glm/mat4x4.hpp>
namespace engine::components {
class ENGINE_API UI : public Component {
public:
UI(Object*);
~UI() override;
// called every frame, do not call manually
void render(glm::mat4 transform, glm::mat4 view);
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;
std::unique_ptr<resources::Mesh> m_atlasMesh;
};
}