Cool, I will definetly download the latest version. Good on you that you found the bugs (y)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
Assertion failed: container != nullptr, file ../WidgetLoader.cpp, line 149
Container.MM
{
position: (100, 100);
size: (100, 100);
visible: true;
enabled: true;
opacity: 1;
}
position: "{&.w - 50, &.h + 5}";
#include <TGUI/Layout.hpp>
tgui::Layout2d parseVector2f(std::string str)
{
if (str.empty())
throw tgui::Exception{ "Failed to parse position. String empty." };
if (str.front() == '(' && str.back() == ')'){
// it's a vector
str = str.substr(1, str.length() - 2);
auto commaPos = str.find(',');
if (commaPos == std::string::npos)
throw tgui::Exception{ "Failed to parse position '" + str + "'. Expected numbers separated with a comma." };
if (str.find(',', commaPos + 1) != std::string::npos)
throw tgui::Exception{ "Failed to parse position '" + str + "'. Expected only one comma." };
return{ tgui::stof(str.substr(0, commaPos)), tgui::stof(str.substr(commaPos + 1)) };
}
else if (str.front() == '"' && str.back() == '"'){
// it's a layout
str = str.substr(1, str.length() - 2);
return{ str };
}
else
throw tgui::Exception{"Failed to parse position '" + str + "'. Malformed."};
}