Forum Discussion

VikR0001's avatar
VikR0001
Visitor
8 years ago

Newbie Q: Understanding How to Bring Up New Screens

I building an app starting from the “Roku Scene Graph – Grid Screen” sample app that comes with the Roku Eclipse Plug-in
 
It opens with this screen (screen #1):



When I click the OK button on the remote, it brings up this screen (screen #2):



Where is the line of code that brings up Screen #2?
 
I’ve been looking for days but haven’t quite figured it out yet. Thanks in advance to all for any info!
 
Best,
 
 
-Vik

13 Replies

  • Thanks for this info, Joe. Could you provide some additional info on the functions used?
  • In the example I'm looking at "Simple Grid and Video" it has HomeScene.xml that has child components such as "GridScreen", an overhang, "Video".
    You can create a new screen like this

    newscreen = createObject("roSGNode","MyScreenComponent")

    (of course you would need an XML and accompanying brs that defines your custom component "MyScreenComponent" as a full screen component, maybe extending Group)
    then if it's created elsewhere, you need to pass that screen node to the HomeScene through a new field defined in HomeScene.xml:
    <field id="myScreenNode" type="node" alwaysnotify="true" onChange="newScreenSet"/>

     and have HomeScene append it as it's last child so it appears over top of anything on screen. in HomeScene.brs:
    sub newScreenSet()
       newScreen = m.top.myScreenNode
       if newScreen <> invalid
           m.top.appendChild(newScreen)
       end if
    end sub