mirror of
https://github.com/edubart/otclient.git
synced 2025-12-21 16:07:12 +01:00
basic menu functionallity
This commit is contained in:
@@ -23,4 +23,26 @@
|
||||
|
||||
|
||||
#include "uilabel.h"
|
||||
#include "../fonts.h"
|
||||
|
||||
UILabel::UILabel(const std::string& text, Font* font) :
|
||||
UIElement(UI::Label),
|
||||
m_text(text),
|
||||
m_font(font)
|
||||
{
|
||||
if(!font)
|
||||
m_font = g_fonts.get("tibia-10px-antialised");
|
||||
setSize(m_font->calculateTextRectSize(text));
|
||||
}
|
||||
|
||||
void UILabel::render()
|
||||
{
|
||||
m_font->renderText(m_text, getRect(), ALIGN_LEFT, Color(0xFFBFBFBF));
|
||||
}
|
||||
|
||||
void UILabel::setText(const std::string& text)
|
||||
{
|
||||
setSize(m_font->calculateTextRectSize(text));
|
||||
m_text = text;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user