Menu screen prototype, refactor
This commit is contained in:
+3
-10
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user