mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 12:49:20 +01:00
Update Screen system
Added FuelScreen (Working buttons) Added SellScreen (Nothing working)
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
#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);
|
||||
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 };
|
||||
@@ -16,4 +25,6 @@ private:
|
||||
|
||||
bool m_IsHovered{ false };
|
||||
bool m_IsPressed{ false };
|
||||
|
||||
std::function<void(void)> m_OnClick{ []() { std::cout << "Button not implemented" << std::endl; } };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user