Developers

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)
Tags (1)
0 Kudos
1 REPLY 1
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!
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!