Forum Discussion

xtr33me's avatar
xtr33me
Visitor
12 years ago

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)

1 Reply

  • "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!