Update Screen system

Added FuelScreen (Working buttons)
Added SellScreen (Nothing working)
This commit is contained in:
Bram Verhulst
2024-04-04 00:07:45 +02:00
parent df9e2f0b64
commit eb4c7b4d76
20 changed files with 759 additions and 45 deletions

View File

@@ -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; } };
};