xtr33me
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014
11:54 AM
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)
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)
2 REPLIES 2

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014
07:15 PM
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
xtr33me
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2014
05:03 AM
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!