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

roScreen

I have a slideshow. From there you call a message dialog that shows info, pauses the slideshow & starts downloading the scrolling image if needed. From the message dialog, you call a roScreen with a large scrolling version of the current slide. However, as soon as the roScreen is called it throws up a black screen until its ready to show the scrolling image.
So, How to get rid of the black screen -
A way to keep it from showing at all until its loaded the way an image canvas does? Can the black be made transparent?
At least a screen facade type thing that works in this situation? ( not my first choice)

Am not real familiar with roScreen so looking for help here.
thanks
Kinetics Screensavers
0 Kudos
6 REPLIES 6
squirreltown
Roku Guru

Re: roScreen

Here is a function showing a roscreen, basically the scroll demo in the SDK. Its reading the image out of tmp:/. The sleep() here is to allow a "loading.." message to show for a second after the function is called (and allow more downloading time) and is not an issue. Assuming the image is completely downloaded and sitting in tmp/ once the code after the sleep() starts executing, the screen goes black instantly, stays black for about 1.5 seconds (roku2XS) and then the roscreen draws nicely, not a fade in but a lot softer than when it cuts out.
Is there a way to keep the roscreen from showing until its rendered, eliminating the black period described above?
Thanks

function Scroll(curr_photo, infomenu, can)

sleep(1200)
time2 = CreateObject("roTimeSpan")
if IsHD()
screen=CreateObject("roScreen", true,1280, 720)
else
screen=CreateObject("roScreen", true)
endif
if true
bigbm=CreateObject("roBitmap", "tmp:/scroll"+curr_photo.GetName())
else ' generic version
bigbm=CreateObject("roBitmap", "tmp:/scroll"+curr_photo.GetName())
end if
if bigbm = invalid
print "bigbm create failed"
stop
endif
backgroundRegion=CreateObject("roRegion", bigbm, 60, 60, screen.getwidth()-120, screen.getheight()-110)
if backgroundRegion = invalid
print "create region failed"
stop
endif
backgroundRegion.SetWrap(false)
screen.clear(&hebebebFF)
screen.drawobject(60, 60, backgroundRegion)

fontReg = CreateObject("roFontRegistry")
fontReg.Register("tmp:/caps.otf")
font = fontReg.GetFont("LMRoman10-Caps", 32, false, false)
font2 = fontReg.GetFont("LMRoman10-Caps", 24, false, false)
text = "Detail - "+chr(34)+curr_photo.GetTitle()+chr(34)
text2 = "*arrow keys scroll"
w = font.GetOneLineWidth(text, 500)
h = font.GetOneLineHeight()
screen.DrawText(text, 50, 27, &h960404FF, font)
screen.DrawText(text2, 960, 35, &h960404FF, font2)
infomenu.close()
can.Close()

screen.SwapBuffers()
Kinetics Screensavers
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roScreen

You might try waiting to create the roScreen until you're ready to display it. Do things like building bitmaps and fonts first.
0 Kudos
squirreltown
Roku Guru

Re: roScreen

OK thanks Chris, I'll try moving stuff around.
Kinetics Screensavers
0 Kudos
squirreltown
Roku Guru

Re: roScreen

Ok i did as Chris suggested and moved all the pre-screen stuff ahead of creating the roScreen, and its a big improvement. Now it just sort of dips to black before showing the roScreen. So i ask my question again, how do I render that roScreen without showing it yet, so it can just pop up? Surely someone with Roku in their name knows the answer to this.
Thanks.

function Scroll(curr_photo, infomenu, can)

sleep(1200)
time2 = CreateObject("roTimeSpan")
bigbm=CreateObject("roBitmap", "tmp:/scroll"+curr_photo.GetName())
fontReg = CreateObject("roFontRegistry")
fontReg.Register("tmp:/caps.otf")
font = fontReg.GetFont("LMRoman10-Caps", 32, false, false)
font2 = fontReg.GetFont("LMRoman10-Caps", 24, false, false)
text = "Detail - "+chr(34)+curr_photo.GetTitle()+chr(34)
text2 = "*arrow keys scroll"
if IsHD()
screen=CreateObject("roScreen", true,1280, 720)
else
screen=CreateObject("roScreen", true)
endif
backgroundRegion=CreateObject("roRegion", bigbm, 60, 60, screen.getwidth()-120, screen.getheight()-110)
backgroundRegion.SetWrap(false)
screen.clear(&hebebebFF)
screen.drawobject(60, 60, backgroundRegion)
screen.DrawText(text, 50, 27, &h960404FF, font)
screen.DrawText(text2, 960, 35, &h960404FF, font2)
infomenu.close()
can.Close()
screen.SwapBuffers()
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: roScreen

"squirreltown" wrote:
So i ask my question again, how do I render that roScreen without showing it yet, so it can just pop up?

You can't. As soon as you create the roScreen, it displays whatever is in the back buffer, so the only thing you can do it swap the buffers immediately and hope the single black frame isn't too jarring. It's a "known issue" but I don't recall if there's ever been any indication from Roku whether it'll be fixed at any point.
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
squirreltown
Roku Guru

Re: roScreen

Thanks for the reply Endless.
Thats a shame, but then there are a ton of visual things that could be cleaned up in this Roku/Brightscript system and I'm sure you've run into a lot more of them then I have.
Kinetics Screensavers
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.