Forum Discussion

TheEndless's avatar
TheEndless
Channel Surfer
15 years ago

In-app screensaver?

I'm sure I'm missing something obvious here, but I can't seem to find a way to prevent the screensaver from showing without interaction from the user. Do the roVideoScreen and roSlideShow have built in "keep-alives" or am I missing something in the SDK apps that are preventing the screensaver from displaying? I'm currently using an roImageCanvas to display a custom screen layout for my application, and would like to have my own in-app screensaver, but can't figure out how to prevent the built-in screensaver from displaying.

Thanks in advance...
TheEndless

14 Replies

  • "TheEndless" wrote:
    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


    AddLayer() is not a member of roImageCanvas. It should be SetLayer().
  • "nowhereman" wrote:
    AddLayer() is not a member of roImageCanvas. It should be SetLayer().

    Ugh... I knew that... I guess the runtime error on that one was posted to the other thread as well. ๐Ÿ˜›

    That was it. Thanks for your help! I really appreciate it!

    Steve
  • Ok.. new issue. With the screensaver, I never seem to get the IsScreenClosed() event that the Clock SDK example suggest I should. In fact, I never seem to get any events in my wait loop. In general, that's not a big deal for the screensaver, but my app seems to lose focus when the screensaver comes up, and I never get it back. I don't know if they're related or not, but I suspect it has something to do with my wait loop never exiting, because I have no way to detect when the screensaver is closed. Any ideas?
  • Scratch that. It seems the same thing happens when the default screensaver is used. I'll start a new thread.