"nowhereman" wrote:
"TheEndless" wrote:
I've also added a "RunScreenSaver()" method that currently simply consists of a "print" so I can see if it's being called. Eventually that will be replaced with code that draws an "roImageCanvas" with my custom screensaver content.
If RunScreenSaver() doesn't contain an event loop, it's probably just returning right away and falling out to the system screen saver. I just tried what you describe and got the same result. My print did not appear on the console and the default SS came on. Try putting up a blank canvas and implementing a simple event loop in RunScreenSaver().
Hrmmm... well, that produced different behavior, which is encouraging, but not the expected behavior. Instead of getting the default screensaver, the screen went black... my code paints it blue and puts text on it, so it's not mine. Interestingly, the wait loop on the screen that was up before the screensaver is still running, so I suspect the screensaver runs in different thread, which would explain why we don't get prints to the console. See anything obviously wrong with this code?
Sub RunScreenSaver()
print "screensaver"
background = {
Color: "#0000FF",
TargetRect: { x: 0, y: 0, w: 1280, h: 720 }
}
text = {
Text: "Screensaver",
TextAttrs: {
Color: "#FFFFFF",
Font: "Large"
},
TargetRect:{ x: 0, y: 500, w: 1280, h: 35 }
}
msgPort = CreateObject( "roMessagePort" )
screen = CreateObject( "roImageCanvas" )
screen.SetMessagePort( msgPort )
screen.SetRequireAllImagesToDraw( false )
screen.AddLayer( 1, background )
screen.AddLayer( 2, text )
screen.Show()
While true
msg = Wait( 1000, msgPort )
If msg.isRemoteKeyPressed() Then
screen.Close()
Return
End If
End While
End Sub
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)