How to display text from a file?

Hi there,

I’ve been working with Corona for several years now, but I still trip up occasionally on the easy stuff so back to the newbie bench for me on this one. Is there a way to pull up and display text on screen from words in a text file rather than from text within the code? Seems like that’s probably a simple thing, but I haven’t been able to find an answer or example of how to do it.

Thanks.

You just need to load the file from the filing system as a string and then display that string as a text object.

https://docs.coronalabs.com/daily/guide/data/readWriteFiles/index.html#reading

https://docs.coronalabs.com/daily/api/library/display/newText.html#multi-line-text

https://gist.github.com/HoraceBury/d8d2fa3382f82a7c7faa

That did it. Thanks a bunch!

You just need to load the file from the filing system as a string and then display that string as a text object.

https://docs.coronalabs.com/daily/guide/data/readWriteFiles/index.html#reading

https://docs.coronalabs.com/daily/api/library/display/newText.html#multi-line-text

https://gist.github.com/HoraceBury/d8d2fa3382f82a7c7faa

That did it. Thanks a bunch!