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: 
TheEndless
Channel Surfer

Re: roListScreen and roImageCanvas

"destruk" wrote:
Why wouldn't you be able to concatenate the lines with chr(13) or chr(10) or /r/n and then use that to display the entire combined entity? That's how I'd do it anyway.

He's trying to create a list of selectable items like an roListScreen. Concatenating the entries into a string doesn't really help in that endeavor.
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
destruk
Streaming Star

Re: roListScreen and roImageCanvas

It's just overlaid text on top of a colored rectangle - so concatenating strings to include line feeds, if you work out the line height for the font, you redraw the entire list when needed or swap layers of the finished element.
But you know that. More than 200 ways to skin a cat - just do you want to have numerous arrays of text variables or one 'grouping' per displayed page of information?
0 Kudos
TheEndless
Channel Surfer

Re: roListScreen and roImageCanvas

"destruk" wrote:
It's just overlaid text on top of a colored rectangle - so concatenating strings to include line feeds, if you work out the line height for the font, you redraw the entire list when needed or swap layers of the finished element.
But you know that. More than 200 ways to skin a cat - just do you want to have numerous arrays of text variables or one 'grouping' per displayed page of information?

That won't work if you want to change the text color for the highlighted button. Either way, you're right.. 200 ways...
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
btpoole
Channel Surfer

Re: roListScreen and roImageCanvas

The Endless supplied a link to an example for creating a selectable list but this leads to another questions. According to the example, each time the remote button is clicked, the code cycles thru each item in the list checking a value which in turn changes the color of the text depending on the value returned. It then pushes the list back to the canvas for show. My question is, doesn't this seem cumbersome to redraw the list each time? I have my channel following this code pretty much now but seems like there should be an easier way other than having to push the entire list each time. The code from the example looks like the following:
	if m.drawtext
textArr = m.create_playlist_text()
yTxt = 100
color = "#00000000"
index = 0
for each str in textArr
if index = m.playing
textColor = "#00ff00"
else
textColor = "#dddddd"
endif
list.Push({
Text: str
TextAttrs: {color: textColor, font: "medium"}
TargetRect: {x:200, y:yTxt, w: 500, h: 100}
})
yTxt = yTxt + 100
index = index + 1
end for
else
color = "#00000000"
list.Push({
Text: ""
TextAttrs: {font: "medium"}
TargetRect: {x:100, y:600, w: 300, h: 100}
})
endif
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.