In 0.10.0 colored text got introduced to be easily drawn using love.graphics.printf.
I want to print colored text line by line and do this using font:getWrap.
But apparently this function does not keep the color of the colored text!
Here is an example. The left and right block of text should look the same, but they don't:
Code: Select all
coloredtext = {
{255,0,0}, "Red.........................",
{0,255,0}, "Green.......................",
{0,0,255}, "Blue........................",
}
function love.draw()
font = love.graphics.newFont(24)
love.graphics.setFont(font)
love.graphics.printf(coloredtext, 0, 0, 100)
width, wrappedtext = font:getWrap(coloredtext, 100)
for i, t in ipairs(wrappedtext) do
love.graphics.printf(t, 200, 30*(i-1), 100)
end
end