Font:getWrap can now accept a colored text table in the same format as what's accepted by love.graphics.print. Resolves issue #1108.

The returned table of strings still has no color information.
This commit is contained in:
Alex Szpakowski
2015-12-20 19:25:09 -05:00
parent efa08b1e44
commit 2ad1712eaf
3 changed files with 11 additions and 7 deletions
+4 -4
View File
@@ -901,13 +901,13 @@ void Font::getWrap(const ColoredCodepoints &codepoints, float wraplimit, std::ve
}
}
void Font::getWrap(const std::string &text, float wraplimit, std::vector<std::string> &lines, std::vector<int> *linewidths)
void Font::getWrap(const std::vector<ColoredString> &text, float wraplimit, std::vector<std::string> &lines, std::vector<int> *linewidths)
{
ColoredCodepoints codepoints;
getCodepointsFromString(text, codepoints.cps);
ColoredCodepoints cps;
getCodepointsFromString(text, cps);
std::vector<ColoredCodepoints> codepointlines;
getWrap(codepoints, wraplimit, codepointlines, linewidths);
getWrap(cps, wraplimit, codepointlines, linewidths);
std::string line;