
#include "../Gui.h"
#include "../../Gui/CGUI.h"
#include <stdarg.h>

CLabel::CLabel(int X, int Y, std::string TEXT, std::string Name) : CElement(CPos(0,0), CPos(X,Y), 0, 0, Name), Text(TEXT)
{
	this->SetWidth(this->GetFont()->GetTextLenght(this->GetText().c_str()));
	this->SetHeight(this->GetFont()->GetTextHeight());
}

void CLabel::Draw()
{
	this->GetFont()->InitVolatileResources();

	CPos Pos = *this->GetParent()->GetAbsPos() + *this->GetRelPos();
	this->GetFont()->DrawText( Pos.GetX(), Pos.GetY(), BLACK, NULL, this->GetText().c_str() );

	this->GetFont()->FreeVolatileResources();
}

void CLabel::MouseMove( CMouse *Mouse )
{
/*
	if mouse over, isinarea textlength
*/
}

std::string CLabel::GetText()
{
	return this->Text;
}