Menu screen prototype, refactor

This commit is contained in:
MihailRis
2023-11-16 03:00:05 +03:00
parent 5af04e20d1
commit b03bcb5191
14 changed files with 267 additions and 52 deletions
+3 -10
View File
@@ -8,6 +8,7 @@
class Batch2D;
class Assets;
class Camera;
/*
Some info about padding and margin.
@@ -44,19 +45,12 @@ namespace gui {
class UINode;
class Container;
typedef std::function<void()> ontimeout;
struct IntervalEvent {
ontimeout callback;
float interval;
float timer;
};
class GUI {
Container* container;
std::shared_ptr<UINode> hover = nullptr;
std::shared_ptr<UINode> pressed = nullptr;
std::shared_ptr<UINode> focus = nullptr;
std::vector<IntervalEvent> intervalEvents;
Camera* uicamera;
public:
GUI();
~GUI();
@@ -67,8 +61,7 @@ namespace gui {
void act(float delta);
void draw(Batch2D* batch, Assets* assets);
void add(std::shared_ptr<UINode> panel);
void interval(float interval, ontimeout callback);
void remove(std::shared_ptr<UINode> panel);
};
}