2021-11-18 15:19:54 +00:00
|
|
|
|
|
|
|
#include "text.hpp"
|
|
|
|
|
|
|
|
namespace LuaUi
|
|
|
|
{
|
2021-11-19 15:21:17 +00:00
|
|
|
LuaText::LuaText()
|
|
|
|
: mAutoSized(true)
|
|
|
|
{}
|
|
|
|
|
2021-11-28 11:31:34 +00:00
|
|
|
void LuaText::setProperties(sol::object props)
|
2021-11-18 15:19:54 +00:00
|
|
|
{
|
2021-11-28 11:31:34 +00:00
|
|
|
setCaption(parseProperty(props, "caption", std::string()));
|
|
|
|
mAutoSized = parseProperty(props, "autoSize", true);
|
|
|
|
WidgetExtension::setProperties(props);
|
2021-11-18 15:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MyGUI::IntSize LuaText::calculateSize()
|
|
|
|
{
|
|
|
|
if (mAutoSized)
|
|
|
|
return getTextSize();
|
|
|
|
else
|
|
|
|
return WidgetExtension::calculateSize();
|
|
|
|
}
|
|
|
|
}
|