43 Button(
const std::string &label =
"Button",
const std::string &name =
"Button");
62 inline const std::string &
get_label()
const {
return m_label; }
69 inline void set_on_click(std::function<
void()> callback) { m_on_click = callback; }
78 void set_colors(
const glm::vec4 &normal,
const glm::vec4 &hovered,
const glm::vec4 &pressed);
92 inline std::shared_ptr<Text>
get_text() {
return m_text; }
103 bool contains_point(
float x,
float y,
float canvas_width,
float canvas_height)
const;
115 bool handle_mouse_button(
float x,
float y,
bool pressed,
float canvas_width,
float canvas_height);
125 void handle_mouse_move(
float x,
float y,
float canvas_width,
float canvas_height);
134 void render(
float canvas_width,
float canvas_height,
const glm::mat4 &projection)
override;
141 std::shared_ptr<Panel> m_panel;
144 std::shared_ptr<Text> m_text;
147 std::function<void()> m_on_click;
153 glm::vec4 m_color_normal{0.3f, 0.3f, 0.3f, 1.0f};
154 glm::vec4 m_color_hovered{0.4f, 0.4f, 0.4f, 1.0f};
155 glm::vec4 m_color_pressed{0.2f, 0.2f, 0.2f, 1.0f};
158 glm::vec4 m_text_color{1.0f, 1.0f, 1.0f, 1.0f};
UIElement(const std::string &name="UIElement")
Constructor for UIElement.
Definition ui_element.cpp:10
ButtonState
Button states for visual feedback.
Definition button.hpp:27
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12
Panel UI element for displaying colored rectangles.
Text UI element for rendering text strings.
Base class for all UI elements.