Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
xtr33me
Level 7

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
Level 8

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
Level 7

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! Smiley Tongue 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