/*
 * GuiText.h
 *
 *  Created on: 2009-07-11
 *      Author: wasyl
 */

#ifndef GUITEXT_H_
#define GUITEXT_H_

#include <allegro5/allegro.h>
#include <allegro5/a5_font.h>
#include "../prep/misc/Vector2D.h"
#include "../prep/ent/Entity.h"

class GuiText : public Entity
{
protected:
	ALLEGRO_FONT *mFont;
	std::string mText;
	double mTime;
	bool mBlinking;

public:
	GuiText(Vec pos, std::string text, bool blink = false);

	int *indices()
	{
		static int ind[] = {ID("entt"), ID("rndr"), 0};
		return ind;
	}

	int order(int index)
	{
		if (index == ID("rndr"))
			return 60;
		else
			return (int)this;
	}

	void update(double dt);
	void render();

	void setText(std::string text) { mText = text; }
};


#endif /* GUITEXT_H_ */
