mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 21:01:48 +01:00
33 lines
763 B
C++
33 lines
763 B
C++
#pragma once
|
|
#include <functional>
|
|
#include <iostream>
|
|
|
|
#include "GuiElement.h"
|
|
#include "Texture.h"
|
|
#include "../TextureManager.h"
|
|
|
|
class GuiButton : public GuiElement
|
|
{
|
|
public:
|
|
GuiButton() = default;
|
|
GuiButton(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager);
|
|
~GuiButton() override;
|
|
virtual void Draw() const override;
|
|
virtual void Update(float elapsedSec) override;
|
|
|
|
void SetOnClick(std::function<void(void)> onClick) {
|
|
m_OnClick = onClick;
|
|
}
|
|
|
|
private:
|
|
Texture* m_Texture{ nullptr };
|
|
Vector2f m_Position;
|
|
Vector2f m_Size;
|
|
|
|
bool m_IsHovered{ false };
|
|
bool m_IsPressed{ false };
|
|
bool m_IsPrimed{ false };
|
|
|
|
std::function<void(void)> m_OnClick{ []() { std::cout << "Button not implemented" << std::endl; } };
|
|
};
|