renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2012
06:29 PM
roScreen, screen saver and Roku 2
I hope I'm doing something wrong, but if I have an roScreen open and the screen saver kicks in the screen basically is frozen once the screen saver is dismissed. The code still appears to be operating properly, but no updates appear on the screen. On a 1st generation unit everything works just fine (including getting the screen saver to display instead of just a blank screen). Here's some basic code that illustrates the problem:
-JT
Sub RunUserInterface()
screenFacade = CreateObject("roPosterScreen")
screenFacade.showMessage("")
screenFacade.show()
port = CreateObject("roMessagePort")
screenFacade.SetMessagePort(port)
di = CreateObject("roDeviceInfo")
m.dsize = di.GetDisplaySize()
if m.dsize.w = 1280 then
m.screen = CreateObject("roScreen")
else
m.screen = CreateObject("roScreen",false,640,480)
end if
if type(m.screen) <> "roScreen"
print "Unable to open screen"
return
end if
m.screen.SetPort(port)
m.screen.SetAlphaEnable(true)
m.screen.Clear(&h108010FF)
m.screen.Finish()
m.compositor = CreateObject("roCompositor")
m.compositor.SetDrawTo(m.screen, &h108010FF)
bm = CreateObject("roBitmap", {width:50, height:50, AlphaEnable:true})
bm.Clear(&h801010FF)
region = CreateObject("roRegion",bm,0,0,bm.GetWidth(),bm.GetHeight())
sprite = m.compositor.NewSprite(0,0,region)
print type(sprite)
while true
msg = wait(1000,port)
print "Moving..."
sprite.MoveTo(rnd(m.dsize.w-bm.GetWidth()),rnd(m.dsize.h-bm.GetHeight()))
m.compositor.Draw()
m.screen.Finish()
end while
End Sub
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
1 REPLY 1
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2012
10:40 PM
Re: roScreen, screen saver and Roku 2
On roku2 if you change your .finish() to .swapbuffers() then it loses the background color but the sprite still animates after returning from the screensaver. --confirmed it stops updating the visible screen after returning from the screensaver if you're using .finish()