Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
EnTerr
Level 8

shortDescriptionLine# length in roListScreen

How can i determine the approx. length of the text that will be displayed in ShortDescriptionLine1 and 2 - by roListScreen?

What i am trying to do is to display maximum amount of text under the poster image (on the right side, using roListScreen). The ShortDescriptionLine1 and ShortDescriptionLine2 (metadata) attributes of the selected item are shown there, each of them displays 1 or 2 lines of text (and it varies).

I have a piece of text and would like to show as much as possible of it - presumably by splitting some of it in ShortDescriptionLine1 and the rest to ShortDescriptionLine2. I don't mind the difference in fonts for both (ShortDescriptionLine1 is shown with more prominent size/weight, #2 is tad smaller). If i don't choose wisely and chunk is too long, ShortDescriptionLine1 will chew the end and replace it with "...".

I don't need exact solution, a decent approximation would do. I think this depends on how roListScreen drawing routine makes its drawing decisions.
0 Kudos
1 Reply
EnTerr
Level 8

Re: shortDescriptionLine# length in roListScreen

<drama sigh> I had to settle on using the following unsightly function with different hand-picked len params
function cleave(s as String, ln as Integer):
'given _s_, split into 2 strings
'so that 1st string be of len <= ln

'try to split on a preceding space
for i = ln to ln - 15 step -1:
if s.mid(i, 1) = " " then ln = i: exit for
end for
return [s.left(ln), s.mid(ln)]
end function

But if someone comes with something better, let me know.
0 Kudos