Files
dae16-VerhulstBram-GameProject/Game/Gui/Button.h
Bram Verhulst 71d364d9d8 Added inheritance for the screen system
basic edge detection for tile rendering
2024-04-04 13:49:38 +02:00

32 lines
660 B
C++

#pragma once
#include <functional>
#include <iostream>
#include "Texture.h"
#include "../TextureManager.h"
class Button
{
public:
Button() = default;
Button(const std::string& filePath, Point2f pos, Point2f size, TextureManager* manager);
~Button();
void Draw() const;
void Update(float elapsedSec);
void SetOnClick(std::function<void(void)> onClick) {
m_OnClick = onClick;
}
private:
Texture* m_Texture{ nullptr };
Point2f m_Position;
Point2f 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; } };
};