2012-07-19 01:14:17 +00:00
|
|
|
#ifndef _GUICOMPONENT_H_
|
|
|
|
#define _GUICOMPONENT_H_
|
|
|
|
|
2012-07-19 16:13:27 +00:00
|
|
|
#include <vector>
|
|
|
|
#include "Renderer.h"
|
2012-07-20 01:08:29 +00:00
|
|
|
#include "InputManager.h"
|
2012-07-19 16:13:27 +00:00
|
|
|
|
2012-07-19 01:14:17 +00:00
|
|
|
class GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2012-07-19 16:13:27 +00:00
|
|
|
void render();
|
|
|
|
virtual void onRender() { };
|
2012-07-20 01:08:29 +00:00
|
|
|
virtual void onInput(InputManager::InputButton button, bool keyDown) { };
|
2012-07-19 16:13:27 +00:00
|
|
|
virtual unsigned int getLayer() { return BIT(0); };
|
|
|
|
|
|
|
|
void addChild(GuiComponent* comp);
|
|
|
|
void removeChild(GuiComponent* comp);
|
|
|
|
unsigned int getChildCount() { return mChildren.size(); }
|
|
|
|
GuiComponent* getChild(unsigned int i) { return mChildren.at(i); }
|
|
|
|
private:
|
|
|
|
std::vector<GuiComponent*> mChildren;
|
2012-07-19 01:14:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|