Hi,
I don't know if I'm doing something wrong but I'm not able to display the new line with the textWrap when I load the text from a txt file. The \n is displayed as a normal text. Did I miss something ? If I put the text directly in the code it works. Here is my code:
local file = io.open("text/"..pageNumber..".txt", "r")
local str = file:read("*all")
file:close()
local text = TextWrap.new(str, width, "left", 20, conf.textFont)
text:setPosition(x,y)
self:addChild(text)
Thank you a lot for you help!
Comments
Hi, the \n are directly in the text contains in the text file. Do I need convert them ?
https://www.facebook.com/lesptitboutchoux
https://www.facebook.com/lesptitboutchoux
https://www.facebook.com/lesptitboutchoux
https://www.facebook.com/lesptitboutchoux