Do I need to set color to white before printf(coloredtext)?
Posted: Tue Jan 24, 2017 12:45 am
I have a program which is working as I want it to but I'm not sure why. I have the function below. (the entire project is also attached.) The "textoImprimido" variable in the printf line is defined in another function as "textoImprimido = {Cores.azulMaisEscuro, textoCombinado, Cores.amarelo, textoProximo}". The purpose of this is to print the "textoCombinado" variable as dark blue and the "textoProximo" variable in yellow.
The way the program is now, this works. But it only works properly if I set the color to white, "love.graphics.setColor(Cores.branco)", before the printf. If the color is not set to white, the second text variable is printed yellow as expected, but the first variable prints as black, not dark blue. Is it necessary to set the color to white before using a table as the text variable in a printf statement, or is there something else happening here?
The way the program is now, this works. But it only works properly if I set the color to white, "love.graphics.setColor(Cores.branco)", before the printf. If the color is not set to white, the second text variable is printed yellow as expected, but the first variable prints as black, not dark blue. Is it necessary to set the color to white before using a table as the text variable in a printf statement, or is there something else happening here?
Code: Select all
imprimaTextoImprimido = function()
love.graphics.setColor(Cores.branco)
love.graphics.setFont(font24)
love.graphics.printf(textoImprimido, 700, 155, 460, "left") --imprime texto na caixaJogaTexto
love.graphics.setColor(Cores.branco)
end