Fix digging

This commit is contained in:
Bram Verhulst
2024-05-07 10:35:18 +02:00
parent 77784a167e
commit d3b932df22
20 changed files with 406 additions and 83 deletions

32
Game/Gui/GuiButton.h Normal file
View File

@@ -0,0 +1,32 @@
#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; } };
};