Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
xtr33me
Visitor

How to get multiline text in roImageCanvas?

I need to display text tot he screen for a POC I'm doing and I have formatted text (somewhat of a table) that I need to display on screen as an overlay when the "A" button is pressed. I am retrieving the data data from a php call and I am just wondering what the best way of displayign the multiline text is. I tried sending back html using "<br />". I also tried using the new line escape sequence which didnt work either. I saw that there is a roParagraphScreen, but I wasn't sure if I can use this in a canvas overlay type setup. Any ideas? Currently using something like the below block, which works great if my text is one line.


textToDisplay = "This is a test"
list.Push({
Text: textToDisplay
TextAttrs: { font: "small" }
TargetRect: canvas.GetCanvasRect()
})

canvas.SetLayer(0, { Color: color, CompositionMode: "Source" })
canvas.SetLayer(1, list)
0 Kudos
2 REPLIES 2
greubel
Visitor

Re: How to get multiline text in roImageCanvas?

Have you tried -> "This is a test"+Chr(10)+"Line two"+Chr(10)+"Line three"
0 Kudos
xtr33me
Visitor

Re: How to get multiline text in roImageCanvas?

"greubel" wrote:
Have you tried -> "This is a test"+Chr(10)+"Line two"+Chr(10)+"Line three"



Greubel I love you! 😛 Thank you sooooooooooo much! I was writing this much more complicated method detecting font height and all for something I jsut wanted to display for the POC in a semi-formatted way. This worked perfectly and I can't thank you enough for the reply! Have a great day mate!
0 Kudos