ES-DE/src/GuiComponent.h
Aloshi 42a39c52e6 Added InputManager; GuiComponents can register themselves to receive input events.
Added text rendering to Renderer, which uses SDL_ttf. Using LinLibertine_R.ttf font (GPL).
A lot more - soon I should have the "skeleton" done.
2012-07-19 20:08:29 -05:00

25 lines
583 B
C++

#ifndef _GUICOMPONENT_H_
#define _GUICOMPONENT_H_
#include <vector>
#include "Renderer.h"
#include "InputManager.h"
class GuiComponent
{
public:
void render();
virtual void onRender() { };
virtual void onInput(InputManager::InputButton button, bool keyDown) { };
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;
};
#endif