Developing Screensavers with SceneGraph in Roku

Developing Screensavers with SceneGraph in Roku

01 October 2020

Roku is not limited to only application development and game development. It also allows us to create or develop a custom screensaver for it. It’s just as easy as other developments on Roku and that’s the reason Roku channel store is growing exponentially.

This post will be helpful for all the budding developers who are going to start their journey with Roku development.


Screensavers are basically channels designed with different screens to be played in the background of any other channel. Designing of the UI is the same for screensaver just like other channels, it’s just a change in entry point from main().

Types of Screensavers

Public –  SceneGraph screensavers use the RunScreenSaver as an entry point and other options will be including RunUserInterface or Main() function.

Private – Private screensavers will not be added in the screensaver menu and it overrides the current screensaver being used. It is only displayed within a specific channel. To make screensaver private, create an entry named ‘screensaver_private’ in the manifest file of the channel.

Entry Points

RunScreenSaver – This function will be called when the screensaver is launched from the screensaver menu.

RunUserInterface – This function will be called when the screensaver is launched from the home screen. It allows the use of any BrightScript or SceneGraph component.

RunScreenSaverSettings – This function can be used to modify settings such as colors, fonts, etc.

Creating a Screensaver

roSGScreen component will be used while creating a screensaver with SceneGraph. It will allow us to directly create a scene with nodes. These components should be created in the main BrightScript file.

screen = CreateObject(“roSGScreen”)

While creating a screensaver using RunUserInterface function, a message port should be used to observe events from SceneGraph XML. It is useful for triggering responses from the screensaver based on events.

m.port = CreateObject(“roMessagePort”)


glb = screen.getGlobalNode()

glb.AddField(“MyField”, “int”, true)

glb.MyField = 100

Scene = screen.createScene(“screensaver”)


The first function which is called when a channel is launched is init(). This function can be used to call other functions, set listeners, and observable events in SceneGraph.

function init()

m.animationNode =“SceneAnimation”) = “pkg:/images/background.jpg”


end function


Animation can also be added to screensavers using animation nodes. Just create a node that needs to be animated and add an animation node to modify its behavior.






translation="[300, 150]" >


text="SceneGraph Screensaver" 











easeFunction="linear" >





FieldToInterp=“Ball.translation” />


To know in more details about Screensavers in Roku and its implementation, please visit:

Blog Categories
Request a quote