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: 
EnTerr
Roku Guru

Re: roTextScreen and auto/manual focus on a button.

"TheEndless" wrote:
Hehe.. there's no built-in method of setting focus on the buttons, what makes you think there'd be a way to determine if it's scrollable? 😛 Nope, making an educated guess based on content length is probably your best bet.

So, there is no hope of customizing the font size, as to actually make the text readable in a 10-foot experience, huh?
I understand lawyers need of using fine print as small as possible (so nobody can actually read it) - but roTextScreen is almost finished and ready for use to show long texts - almost.
0 Kudos
dev42
Visitor

Re: roTextScreen and auto/manual focus on a button.

Never heard the "official" term for it. Nice to learn that Couch OS == ten-foot user interface. 😉

I suppose I have similar Q's in regard to roTextScreen:
  1. control the width of the textbox
  2. use a fixed-width font
  3. scroll to end of textbox at .show() when I choose to


peace & 42
0 Kudos
dcrandall
Visitor

Re: roTextScreen and auto/manual focus on a button.

"dev42" wrote:
Never heard the "official" term for it. Nice to learn that Couch OS == ten-foot user interface. 😉

I suppose I have similar Q's in regard to roTextScreen:
  1. control the width of the textbox
  2. use a fixed-width font
  3. scroll to end of textbox at .show() when I choose to


peace & 42



The only one I could suggest for the '.show()' is send a down-arrow press 37 times to scroll to the end? 😄
0 Kudos
EnTerr
Roku Guru

Re: roTextScreen and auto/manual focus on a button.

"dcrandall" wrote:
The only one I could suggest for the '.show()' is send a down-arrow press 37 times to scroll to the end? 😄

Care to imagine the sound of 37 clicks? :mrgreen:
0 Kudos
dev42
Visitor

Re: roTextScreen and auto/manual focus on a button.

Apologies for the late response! Thanks for the reply.

I've been knee deep in self pity as I've been trying to roll my own textScreen.

Now that I have something mostly* working, I can say that, I've been humbled. Greatly.

peace & 42

* mostly (adverb): for the greatest part : mainly.
... as in, I still have text that can exit the box! ( parsing issue. data used elsewhere. )
... and I haven't even started looking into making it SD resolution functional
... and no vertical scroll-bar / visible clue as to where in the text we're at
... and NO awesome click sound effects! OH THE HUMANITY. ( honestly I like 'em... mostly )
0 Kudos
RokuJoel
Binge Watcher

Re: roTextScreen and auto/manual focus on a button.

* mostly (adverb): for the greatest part : mainly.
... as in, I still have text that can exit the box! ( parsing issue. data used elsewhere. )


If you draw to a region then draw the region to the screen, it should automatically clip any overflow.

... and I haven't even started looking into making it SD resolution functional


If you just define the roScreen as 1280x720 and pretend there is no SDTV mode, the hardware will take care of it for you.

... and no vertical scroll-bar / visible clue as to where in the text we're at


That should not be too difficult to do

... and NO awesome click sound effects! OH THE HUMANITY. ( honestly I like 'em... mostly )


take a look at roAudioResource. Sound effects are pretty easy, limitations are you need to use very small 16bit .wav files for your effects.
0 Kudos
dev42
Visitor

Re: roTextScreen and auto/manual focus on a button.

If you draw to a region then draw the region to the screen, it should automatically clip any overflow.

Thanks for the tip, but I'm sorta in a paradox on this one. I haven't yet proven that anything greater than 80 chars is clip-able or for that matter necessary to show at all. Granted having it go outside my textbox and out the side of the screen isn't a solution. I just haven't decided if I'll manually insert a CR, LF, CRLR ( or is it LFCR? ) If I do that, then I have to count the lines being shown in the textbox differently or create a backup copy of the original data and not skip lines when moving up and down, when the wrapped lines scroll off the screen. I'm not converting the whole data and formatting it for my textbox control. I'm culling the lines I don't need and sending off the shortened roList. Decisions. decisions.

FWIW, since the data is a roList of strings, I'd just take the first 80 chars that way.

If you just define the roScreen as 1280x720 and pretend there is no SDTV mode, the hardware will take care of it for you.

Is that enough to pass certification?
Similarly, how often are we allowed to update our app after it is published?

... and no vertical scroll-bar / visible clue as to where in the text we're at


That should not be too difficult to do

Oh, but my talent lies in making things difficult! Smiley LOL

Knowing what line I'm on and how many lines there are gives a percentage and via that we can drawRect() where it needs to be... just need a little more functionality as the data is not static. IOW, the size of the scroll bar widget thing.

Again, I agree, not too difficult. Just dealing with prioritizing tasks. First looking into changing the resolution to 1280x720 and see what falls off the screen and then change *all* objects to use relative screen positioning ( just in case the screen resolution needs to be changed in the future ). Also, the same method is being called for both my textbox control and my menu control... but doable. Totally doable.

take a look at roAudioResource. Sound effects are pretty easy, limitations are you need to use very small 16bit .wav files for your effects.

Yes, thank you. I've been using the Snake SDK example for some insights.
0 Kudos
EnTerr
Roku Guru

Re: roTextScreen and auto/manual focus on a button.

Or you know... alternatively RokuCo may just fix roTextScreen so we don't have to re-invent the wheel. Somebody has already spent the time to do the scroll and bounding etc. 90%+ of the work was done, just fix few bugs and add font size.

Am i too extreme? 8-)
I see it as law of conservation of effort. Laziness - the first of the three great virtues of a programmer.
0 Kudos
YoJae
Visitor

Re: roTextScreen and auto/manual focus on a button.

There is a simpler trick. You first set up top button, then show() the screen, then add text and then other buttons. Testes on Roku v6.02. When you start the screen the text blinks once, but this is much better then be out of focus.


screen.AddButton(1, "Ok")
screen.show()
screen.SetText("Lorem ipsum dolor sit amet")
screen.AddButton(2, "Not ok")
0 Kudos
TheEndless
Channel Surfer

Re: roTextScreen and auto/manual focus on a button.

"YoJae" wrote:
There is a simpler trick. You first set up top button, then show() the screen, then add text and then other buttons. Testes on Roku v6.02. When you start the screen the text blinks once, but this is much better then be out of focus.


screen.AddButton(1, "Ok")
screen.show()
screen.SetText("Lorem ipsum dolor sit amet")
screen.AddButton(2, "Not ok")

Actually, if you rearrange that a little more, you can avoid the flashing, too. This is how I typically do it:
    screen = CreateObject("roTextScreen")
screen.SetMessagePort(CreateObject("roMessagePort"))

' Add empty text initially
screen.SetText("")
' Add the buttons
screen.AddButton(0, "I agree")
screen.AddButton(1, "Cancel")
' Show the screen
screen.Show()
' At this point the buttons should have focus, so now add the real text
screen.AddText("Real text goes here")
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