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: 
edu82mug
Visitor

not for streaming

hi guys, i'm from indonesia. i have a question in my head, is it possible i create a channels are used not for streaming like video, music or photo. but i want to use it for display data like article on newspaper (including picture and text)?
have you any sample for me?

thanks
edward
0 Kudos
3 REPLIES 3
bandal
Visitor

Re: not for streaming

Most likely you can use the RSS Feeds and pipe it thru Roku. I have investigated that for Indonesia already and may have something soon to show.
0 Kudos
RokuJoel
Binge Watcher

Re: not for streaming

Yes, you could do that, we don't have any samples that would show you how to elegantly display text, but it can definitely be done. It will require some skill at programming. The components to look at would be roImageCanvas and roScreen. If you have specific questions on how to implement various particular aspects of this, you can post them on this forum.

- Joel
0 Kudos
RokuJoel
Binge Watcher

Re: not for streaming

Actually, for anyone who is interested in Text display, here is a rudimentary Text wrapping function, where fo is an roFont, px is the type size, and maxwidth is the number of pixels. This function could be improved significantly, for example, maxwidth should be a separate parameter from paragraph width.


function linebreak(text as string,fo as object,px as integer,maxwidth as integer) as object

timer=createobject("rotimespan")
timer.mark()
arr=text.tokenize(" ")
line=arr[0]

paragraph=[]
length=fo.getonelinewidth(line,maxwidth)
?"length: ";length;
?"maxwidth: ";maxwidth
inc=1

while inc < arr.count()-1

length=fo.getonelinewidth(line+" "+arr[inc],maxwidth)
?"length: ";fo.getonelinewidth(line,maxwidth);" line: ";line;
?"length: ";fo.getonelinewidth(line+" "+arr[inc],maxwidth);" line+: ";line+" "+arr[inc]

if length >= maxwidth -30
paragraph.push(line)
length=0
line=""
line=line+arr[inc]
inc=inc+1
else if length < maxwidth-30 and paragraph.count()<2 then
line=line+" "+arr[inc]
inc=inc+1
else
line=line+" "+arr[inc]
inc=inc+1
end if
end while
line=line+" "+arr[inc]
paragraph.push(line)
'? "FINAL paragraph":
'? paragraph
'?"paragraph parsed in: ";timer.totalmilliseconds()
return paragraph
end function
0 Kudos