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,4 +1,7 @@
#pragma once
#include <vector>
#include "Button.h"
#include "structs.h"
#include "Texture.h"
#include "../TextureManager.h"
@@ -9,18 +12,17 @@ public:
Screen() = default;
Screen(const std::string& filePath, Point2f pos, Point2f size, TextureManager* manager);
~Screen();
virtual ~Screen();
void setActive(bool active) { m_Active = active; }
void toggleActive() { m_Active = !m_Active; }
void AddButton(Button* button) { m_Buttons.push_back(button); }
void Update(float elapsedSecs);
void Draw() const;
virtual void Update(float elapsedSecs);
virtual void Draw() const;
private:
Point2f m_Position;
Point2f m_Size;
Texture* m_Background{ nullptr };
bool m_Active{ false };
std::vector<Button*> m_Buttons;
};