loading ui from files

This commit is contained in:
Eduardo Bart
2011-04-10 04:34:52 -03:00
parent 150afa86f3
commit 792d661dad
15 changed files with 276 additions and 12 deletions

View File

@@ -35,6 +35,15 @@ UILabel::UILabel(const std::string& text, Font* font) :
setSize(m_font->calculateTextRectSize(text));
}
void UILabel::load(const YAML::Node& node)
{
UIElement::load(node);
std::string text;
node["text"] >> text;
setText(text);
}
void UILabel::render()
{
m_font->renderText(m_text, getRect(), ALIGN_LEFT, Color(0xFFBFBFBF));