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

roImageCanvas Text wrapping not working

I am putting together a POC for a presentation and I need to display an encoded value and then the decoded value on screen. Now I have the decoded workign nicely, however the encoded vale comes in as a string of about 1024 characters. Now I am using the below code and when I display it on the screen, it doesn't stay in the rect at all. I can move the x and y around and that works, but it doesnt even recognize the width and height values at all. Am I doing something wrong?

arr = CreateObject("roAssociativeArray")
raw["targetRect"] = {x:100, y: 100, w:20, h:100}
raw["textAttrs"] = { font: "small", color:m.textColor, HAlign: "Left", VAlign: "Top" }
raw["text"] = encodedVal
m.canvas.SetLayer(1, raw)
0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: roImageCanvas Text wrapping not working

I believe the image canvas will only wrap text at non-word characters (e.g., space, hyphen, carriage return, etc.), so you'll probably need to add spaces into the string to get it to wrap, or implement your own wrapping.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
xtr33me
Visitor

Re: roImageCanvas Text wrapping not working

Thanks theEndless for the response. I ended up writing something that did that and as you stated, this is a continuous string of characters so guess that is why it wasn't working. Thanks again mate!
0 Kudos