mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-17 01:11:47 +01:00
32 lines
664 B
C++
32 lines
664 B
C++
#pragma once
|
|
#include <functional>
|
|
#include <iostream>
|
|
|
|
#include "Texture.h"
|
|
#include "../TextureManager.h"
|
|
|
|
class Button
|
|
{
|
|
public:
|
|
Button() = default;
|
|
Button(const std::string& filePath, Vector2f pos, Vector2f 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 };
|
|
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; } };
|
|
};
|