Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
problem with new line (\n) in textWrap — Gideros Forum

problem with new line (\n) in textWrap

anneMurielleanneMurielle Member
edited December 2013 in General questions
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

Sign In or Register to comment.